diff --git a/CHANGELOG.md b/CHANGELOG.md index 03727f47..0fcc76d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ tagged `vX.Y.Z`. ### Added - **GitHub rows open on the Mac.** Open a saved run, notification or pull request from a widget without marking it read. - **cmux session navigation.** A Claude card selects its cmux panel through the bundled CLI when the running process identifies both workspace and surface and socket access allows it. Otherwise it brings cmux forward. +- **Optional Apple Silicon CPU temperature.** Install macmon separately and enable it in Screen privacy settings. Sampling stays local and off by default; a recent reading does not delay system metrics. - **Local Docker and AI models.** Registry widgets can show up to 200 local containers and observed Ollama or MLX models. Fremkit refuses remote Docker contexts, distinguishes a missing CLI from a stopped daemon, and keeps the container list when stats fail. - **The Uptime tile shows time since boot.** The reading comes from macOS and remains unavailable when the system cannot provide it. - **Borrow the Edge display.** Hide or show the dashboard from the helper menu without quitting it. Hidden state survives display rearrangements, and the mouse fence pauses while the Edge is borrowed. Touch and data collection continue; the dashboard reappears after a helper restart. diff --git a/docs/widgets.md b/docs/widgets.md index 48e47907..98c4ab24 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -163,7 +163,7 @@ Each `cities` item: `label` (string), `timezone` (timezone), `hour12` (boolean, ## cpu -*CPU* — load and, when the machine reports one, temperature. +*CPU* — load and, when the machine reports one, temperature. On Apple Silicon, install the third-party open-source tool with `brew install macmon`, then enable **Read the CPU temperature with macmon** in Screen privacy settings. Fremkit does not install macmon. After opt-in, it runs only `/opt/homebrew/bin/macmon` or `/usr/local/bin/macmon` locally every 10 seconds, returns the last reading without delaying CPU load, and falls back to the system value if no recent macmon sample is available. Minimum size 8 × 4, default 8 × 4. Compact width 4 cells. diff --git a/server/src/app.ts b/server/src/app.ts index 817f472a..e0e2d4d7 100644 --- a/server/src/app.ts +++ b/server/src/app.ts @@ -54,6 +54,7 @@ import { backupRoutes } from './backup/routes.js' import { bambuRoutes } from './bambu/routes.js' import { createShortcutsProvider } from './providers/shortcuts.js' import { createServiceStatusProvider } from './providers/service-status.js' +import { createSystemProvider } from './providers/system.js' import { findInstance, findInstances } from './config/instances.js' import { migrateHomeySecret } from './config/migrate.js' import { BYTES_CSP, isByteRoute } from './http/headers.js' @@ -149,6 +150,8 @@ export async function buildApp(opts: AppOptions): Promise { ) hub = new Hub(registry) for (const p of opts.providers ?? []) registry.register(p) + // Consent lives in the config store, so this provider is registered beside the Claude providers. + registry.register(createSystemProvider({ macmonTemperatureEnabled: () => store.get().privacy.macmonTemperature })) registry.register(createClaudeSessionsProvider(tracker)) registry.register(createClaudeUsageProvider(usage)) registry.register(createClaudeAccountProvider({ diff --git a/server/src/config/migrate.ts b/server/src/config/migrate.ts index 746a2209..a7ff0e2e 100644 --- a/server/src/config/migrate.ts +++ b/server/src/config/migrate.ts @@ -152,7 +152,7 @@ export function migrateConfig(raw: unknown): Config { connections: [], secrets: { backend: defaultSecretsBackend() }, locale: defaultLocale(), - privacy: { claudeAccountUsage: false, showAccountEmail: false, codexAccount: false, codexHistorySources: [] }, + privacy: { claudeAccountUsage: false, showAccountEmail: false, codexAccount: false, codexHistorySources: [], macmonTemperature: false }, // A v1 config predates the marketplace by a long way; nothing can have been installed. marketplace: { installed: {} }, pages: v1.pages.map((p) => ({ diff --git a/server/src/config/schema.ts b/server/src/config/schema.ts index ad6bbf43..5292fca4 100644 --- a/server/src/config/schema.ts +++ b/server/src/config/schema.ts @@ -248,6 +248,8 @@ const PrivacySchema = z.object({ showAccountEmail: z.boolean().default(false), codexAccount: z.boolean().default(false), codexHistorySources: z.array(HistorySourceSchema).max(10).default([]), + /** Read CPU temperature from the optional local macmon executable. */ + macmonTemperature: z.boolean().default(false), }).prefault({}) /** @@ -352,7 +354,7 @@ export const DEFAULT_CONFIG: Config = { connections: [], secrets: { backend: defaultSecretsBackend() }, locale: defaultLocale(), - privacy: { claudeAccountUsage: false, showAccountEmail: false, codexAccount: false, codexHistorySources: [] }, + privacy: { claudeAccountUsage: false, showAccountEmail: false, codexAccount: false, codexHistorySources: [], macmonTemperature: false }, marketplace: { installed: {} }, pages: [ { diff --git a/server/src/providers/index.ts b/server/src/providers/index.ts index fa5970d8..ef18fa20 100644 --- a/server/src/providers/index.ts +++ b/server/src/providers/index.ts @@ -1,6 +1,5 @@ import { createDockerProvider, createLocalModelsProvider } from './local-operations.js' import type { Provider } from './types.js' -import { systemProvider } from './system.js' import { processesProvider } from './processes.js' import { createVolumeProvider } from './volume.js' import { createSpotifyProvider } from './spotify.js' @@ -13,7 +12,6 @@ import { createBatteryProvider } from './battery.js' export const providers: Provider[] = [ createDockerProvider(), createLocalModelsProvider(), - systemProvider, processesProvider, createVolumeProvider(), createSpotifyProvider(), diff --git a/server/src/providers/mac-thermals.ts b/server/src/providers/mac-thermals.ts new file mode 100644 index 00000000..afa6021c --- /dev/null +++ b/server/src/providers/mac-thermals.ts @@ -0,0 +1,67 @@ +import { execFile } from 'node:child_process' +import { promisify } from 'node:util' + +export interface MacTemperature { + cpuCelsius: number | null + updatedAt: number | null + error: 'unconfigured' | 'offline' | 'invalid' | 'unsupported' | null +} + +const unknown = (error: MacTemperature['error']): MacTemperature => ({ cpuCelsius: null, updatedAt: null, error }) +const exec = promisify(execFile) +type Runner = (file: string, args: string[]) => Promise +const run: Runner = async (file, args) => (await exec(file, args, { timeout: 4000, maxBuffer: 64 * 1024, encoding: 'utf8' })).stdout + +/** Accept only a recent bounded sensor reading, never an estimate from CPU load. */ +export function parseMacTemperature(output: string, now: number): MacTemperature { + try { + const data = JSON.parse(output.trim()) + const updatedAt = typeof data?.timestamp === 'string' ? Date.parse(data.timestamp) : NaN + const value = data?.temp?.cpu_temp_avg + if (!Number.isFinite(updatedAt) || now - updatedAt > 30_000 || updatedAt - now > 5_000) return unknown('invalid') + if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0 || value >= 150) return unknown('invalid') + return { cpuCelsius: Math.round(value * 10) / 10, updatedAt, error: null } + } catch { return unknown('invalid') } +} + +/** Return the last reading immediately. A bounded macmon refresh runs in the background. */ +export function createMacTemperatureReader(options: { run?: Runner; now?: () => number; platform?: string; arch?: string } = {}) { + const execute = options.run ?? run + const now = options.now ?? Date.now + const supported = (options.platform ?? process.platform) === 'darwin' && (options.arch ?? process.arch) === 'arm64' + let cached = unknown(null) + let checkedAt = -Infinity + let pending: Promise | null = null + function failed(error: MacTemperature['error']): void { + // Keep the last valid sample until it expires, even when one refresh fails. + cached = cached.cpuCelsius !== null && cached.updatedAt !== null + ? { ...cached, error } : unknown(error) + } + async function refresh(): Promise { + for (const binary of ['/opt/homebrew/bin/macmon', '/usr/local/bin/macmon']) { + try { + const sample = parseMacTemperature(await execute(binary, ['pipe', '-s', '1', '-i', '500']), now()) + if (sample.cpuCelsius !== null) cached = sample + else failed(sample.error) + checkedAt = now() + return + } catch (error) { + if ((error as NodeJS.ErrnoException).code !== 'ENOENT') { + failed('offline') + checkedAt = now() + return + } + } + } + failed('unconfigured') + checkedAt = now() + } + return (): MacTemperature => { + if (!supported) return unknown('unsupported') + if (!pending && now() - checkedAt >= 10_000) { + pending = refresh().finally(() => { pending = null }) + } + return cached.updatedAt !== null && now() - cached.updatedAt > 30_000 + ? { ...cached, cpuCelsius: null, error: cached.error ?? 'invalid' } : cached + } +} diff --git a/server/src/providers/system.ts b/server/src/providers/system.ts index 48c82698..ae4f04db 100644 --- a/server/src/providers/system.ts +++ b/server/src/providers/system.ts @@ -1,6 +1,7 @@ import si from 'systeminformation' import { uptime } from 'node:os' import type { Provider } from './types.js' +import { createMacTemperatureReader } from './mac-thermals.js' const round = (n: number) => Math.round(n * 10) / 10 @@ -45,19 +46,44 @@ function uptimeSeconds(): number | null { } } -export const systemProvider: Provider = { - channel: 'system', - intervalMs: 2000, - async poll() { - const [load, mem, fs, net, temp] = await Promise.all([ - si.currentLoad(), si.mem(), si.fsSize(), si.networkStats(), si.cpuTemperature(), - ]) - return { - uptimeSeconds: uptimeSeconds(), - cpu: { load: round(load.currentLoad), cores: load.cpus.map((c) => round(c.load)), temp: temp.main > 0 ? round(temp.main) : null }, - memory: { total: mem.total, used: mem.active, free: mem.available, swapUsed: mem.swapused, swapTotal: mem.swaptotal }, - disks: normalizeDisks(fs), - network: net.map((n) => ({ iface: n.iface, rx: Math.max(0, Math.round(n.rx_sec ?? 0)), tx: Math.max(0, Math.round(n.tx_sec ?? 0)) })), - } - }, +export function createSystemProvider(options: { + macmonTemperatureEnabled?: () => boolean + readMacTemperature?: ReturnType +} = {}): Provider { + const readMacTemperature = options.readMacTemperature ?? createMacTemperatureReader() + return { + channel: 'system', + intervalMs: 2000, + async poll() { + const [load, mem, fs, net, temp] = await Promise.all([ + si.currentLoad(), si.mem(), si.fsSize(), si.networkStats(), si.cpuTemperature(), + ]) + const measured = options.macmonTemperatureEnabled?.() ? readMacTemperature() : null + const macmonTemp = measured?.cpuCelsius ?? null + const systemTemp = temp.main > 0 ? round(temp.main) : null + return { + uptimeSeconds: uptimeSeconds(), + cpu: { + load: round(load.currentLoad), + cores: load.cpus.map((c) => round(c.load)), + temp: macmonTemp ?? systemTemp, + tempSource: macmonTemp !== null ? 'macmon' : systemTemp !== null ? 'system' : null, + tempError: measured?.error ?? null, + }, + memory: { + total: mem.total, + used: mem.active, + free: mem.available, + swapUsed: mem.swapused, + swapTotal: mem.swaptotal, + }, + disks: normalizeDisks(fs), + network: net.map((n) => ({ + iface: n.iface, + rx: Math.max(0, Math.round(n.rx_sec ?? 0)), + tx: Math.max(0, Math.round(n.tx_sec ?? 0)), + })), + } + }, + } } diff --git a/server/test/config-migration.test.ts b/server/test/config-migration.test.ts index 933db54c..4d3292b0 100644 --- a/server/test/config-migration.test.ts +++ b/server/test/config-migration.test.ts @@ -112,7 +112,7 @@ describe('ConfigStore migration', () => { }) }) -describe('privacy.claudeAccountUsage on an older config', () => { +describe('privacy settings on an older config', () => { const page = (widgets: object[]) => ({ id: 'home', name: 'Accueil', widgets }) const widget = (widgetId: string) => ({ instanceId: 'a', widgetId, x: 0, y: 0, w: 8, h: 4 }) @@ -156,6 +156,17 @@ describe('privacy.claudeAccountUsage on an older config', () => { it('leaves a fresh install off', () => { expect(DEFAULT_CONFIG.privacy.claudeAccountUsage).toBe(false) }) + it('keeps macmon sampling off for existing configs and fresh installs', () => { + const page = { id: 'home', name: 'Home', widgets: [{ instanceId: 'cpu-1', widgetId: 'cpu', x: 0, y: 0, w: 8, h: 4 }] } + expect(migrateConfig({ version: 2, pages: [page] }).privacy.macmonTemperature).toBe(false) + expect(migrateConfig({ ...DEFAULT_CONFIG, privacy: { claudeAccountUsage: false } }).privacy.macmonTemperature).toBe(false) + expect(DEFAULT_CONFIG.privacy.macmonTemperature).toBe(false) + }) + + it('preserves explicit consent to macmon sampling', () => { + expect(migrateConfig({ ...DEFAULT_CONFIG, privacy: { claudeAccountUsage: false, macmonTemperature: true } }) + .privacy.macmonTemperature).toBe(true) + }) }) describe('privacy.showAccountEmail on an older config', () => { diff --git a/server/test/mac-thermals.test.ts b/server/test/mac-thermals.test.ts new file mode 100644 index 00000000..edac14cd --- /dev/null +++ b/server/test/mac-thermals.test.ts @@ -0,0 +1,74 @@ +import { describe, it, expect, vi } from 'vitest' +import { createMacTemperatureReader, parseMacTemperature } from '../src/providers/mac-thermals.js' + +const now = 1800000000000 +const reading = (value: unknown = 67.483, time = now) => JSON.stringify({ timestamp: new Date(time).toISOString(), temp: { cpu_temp_avg: value, gpu_temp_avg: 70.688 } }) +const flush = () => new Promise((resolve) => setTimeout(resolve, 0)) + +describe('measured Apple Silicon CPU temperature', () => { + it('accepts a recent bounded CPU sample without publishing GPU data', () => { + expect(parseMacTemperature(reading(), now)).toEqual({ cpuCelsius: 67.5, updatedAt: now, error: null }) + }) + it.each([0, -1, NaN, Infinity, 150, '67.5', null])('rejects invalid CPU sample %s', (value) => { + expect(parseMacTemperature(reading(value), now)).toMatchObject({ cpuCelsius: null, error: 'invalid' }) + }) + it.each(['not json', '{}', reading(67, now - 30001), reading(67, now + 5001)])('rejects malformed or stale samples', (output) => { + expect(parseMacTemperature(output, now)).toMatchObject({ cpuCelsius: null, error: 'invalid' }) + }) + it('returns cached data immediately while refreshing only once per ten seconds', async () => { + let clock = now + const run = vi.fn(async () => reading(67, clock)) + const read = createMacTemperatureReader({ platform: 'darwin', arch: 'arm64', now: () => clock, run }) + expect(read()).toMatchObject({ cpuCelsius: null, error: null }) + expect(read().cpuCelsius).toBeNull() + await flush() + expect(read().cpuCelsius).toBe(67) + expect(run).toHaveBeenCalledTimes(1) + clock += 10000 + expect(read().cpuCelsius).toBe(67) + await flush() + expect(run).toHaveBeenCalledTimes(2) + }) + it('keeps a previous sample until it expires after a failed refresh', async () => { + let clock = now + const run = vi.fn().mockResolvedValueOnce(reading()).mockRejectedValueOnce(new Error('denied')) + const read = createMacTemperatureReader({ platform: 'darwin', arch: 'arm64', now: () => clock, run }) + read(); await flush() + expect(read().cpuCelsius).toBe(67.5) + clock += 10000 + read(); await flush() + expect(read()).toMatchObject({ cpuCelsius: 67.5, error: 'offline' }) + clock += 20001 + expect(read()).toMatchObject({ cpuCelsius: null, error: 'offline' }) + }) + it('keeps a recent sample when the next response is malformed', async () => { + let clock = now + const run = vi.fn().mockResolvedValueOnce(reading()).mockResolvedValueOnce('not json') + const read = createMacTemperatureReader({ platform: 'darwin', arch: 'arm64', now: () => clock, run }) + read(); await flush() + clock += 10000 + read(); await flush() + expect(read()).toMatchObject({ cpuCelsius: 67.5, error: 'invalid' }) + }) + it('does not expose an expired cached sample after a long pause', async () => { + let clock = now + const run = vi.fn(async () => reading(67, clock)) + const read = createMacTemperatureReader({ platform: 'darwin', arch: 'arm64', now: () => clock, run }) + read(); await flush() + expect(read().cpuCelsius).toBe(67) + clock += 3600000 + expect(read().cpuCelsius).toBeNull() + await flush() + expect(read().cpuCelsius).toBe(67) + }) + it('uses only fixed install paths and never runs on unsupported systems', async () => { + const run = vi.fn(async (_file: string, _args: string[]) => { throw Object.assign(new Error('missing'), { code: 'ENOENT' }) }) + const read = createMacTemperatureReader({ platform: 'darwin', arch: 'arm64', run }) + read(); await flush() + expect(read().error).toBe('unconfigured') + expect(run.mock.calls.map((args) => args[0])).toEqual(['/opt/homebrew/bin/macmon', '/usr/local/bin/macmon']) + const other = createMacTemperatureReader({ platform: 'linux', arch: 'arm64', run }) + expect(other().error).toBe('unsupported') + expect(run).toHaveBeenCalledTimes(2) + }) +}) diff --git a/server/test/system-thermals.test.ts b/server/test/system-thermals.test.ts new file mode 100644 index 00000000..fed2f087 --- /dev/null +++ b/server/test/system-thermals.test.ts @@ -0,0 +1,35 @@ +import { expect, it, vi } from 'vitest' +import si from 'systeminformation' + +vi.mock('systeminformation', () => ({ + default: { + currentLoad: async () => ({ currentLoad: 12, cpus: [{ load: 12 }] }), + mem: async () => ({ total: 100, active: 40, available: 60 }), + fsSize: async () => [], + networkStats: async () => [], + cpuTemperature: vi.fn(async () => ({ main: 0 })), + }, +})) + +import { createSystemProvider } from '../src/providers/system.js' + +it('never runs the optional sensor before consent and keeps polling without waiting for it', async () => { + let enabled = false + const readMacTemperature = vi.fn(() => ({ cpuCelsius: 55, updatedAt: 1800000000000, error: null as null })) + const provider = createSystemProvider({ macmonTemperatureEnabled: () => enabled, readMacTemperature }) + expect((await provider.poll!() as { cpu: { temp: number | null; tempSource: string | null; tempError: string | null } }).cpu) + .toMatchObject({ temp: null, tempSource: null, tempError: null }) + expect(readMacTemperature).not.toHaveBeenCalled() + enabled = true + expect((await provider.poll!() as { cpu: { temp: number | null; tempSource: string | null; tempError: string | null } }).cpu) + .toMatchObject({ temp: 55, tempSource: 'macmon', tempError: null }) + expect(readMacTemperature).toHaveBeenCalledTimes(1) +}) + +it('reports a missing macmon tool while preserving the system fallback', async () => { + const readMacTemperature = vi.fn(() => ({ cpuCelsius: null, updatedAt: null, error: 'unconfigured' as const })) + vi.mocked(si.cpuTemperature).mockResolvedValueOnce({ main: 42 } as Awaited>) + const provider = createSystemProvider({ macmonTemperatureEnabled: () => true, readMacTemperature }) + expect((await provider.poll!() as { cpu: { temp: number | null; tempSource: string | null; tempError: string | null } }).cpu) + .toMatchObject({ temp: 42, tempSource: 'system', tempError: 'unconfigured' }) +}) diff --git a/server/test/system-uptime.test.ts b/server/test/system-uptime.test.ts index 8fea6034..4ba72a14 100644 --- a/server/test/system-uptime.test.ts +++ b/server/test/system-uptime.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { uptime } from 'node:os' -import { systemProvider } from '../src/providers/system.js' +import { createSystemProvider } from '../src/providers/system.js' vi.mock('node:os', () => ({ uptime: vi.fn() })) vi.mock('systeminformation', () => ({ default: { @@ -12,6 +12,7 @@ vi.mock('systeminformation', () => ({ default: { } })) describe('OS uptime in the system snapshot', () => { + const systemProvider = createSystemProvider() beforeEach(() => vi.mocked(uptime).mockReset()) it.each([0, 90061.9])('publishes system uptime %s seconds rather than process uptime', async (seconds) => { diff --git a/ui/src/admin/ScreenInspector.vue b/ui/src/admin/ScreenInspector.vue index fe19d83f..0ec5753c 100644 --- a/ui/src/admin/ScreenInspector.vue +++ b/ui/src/admin/ScreenInspector.vue @@ -73,6 +73,9 @@ function setCodexSource(source: CodexSource, on: boolean): void { ? [...new Set([...c.privacy.codexHistorySources, source])] : c.privacy.codexHistorySources.filter(value => value !== source) }) } +function setMacmonTemperature(on: boolean): void { + s.apply((c) => { c.privacy.macmonTemperature = on }) +} /** * Off, the server leaves the account e-mail out of every snapshot it publishes; this box does * not hide it in a widget, it decides whether any widget is sent it at all. @@ -306,6 +309,10 @@ function setBackground(patch: Partial): void { @update:model-value="setCodexSource(source, $event)" /> + +

{{ t('admin.inspector.screen.macmonTemperature.hint') }}

diff --git a/ui/src/shared/locales/en.ts b/ui/src/shared/locales/en.ts index 019a1a39..cb2f290a 100644 --- a/ui/src/shared/locales/en.ts +++ b/ui/src/shared/locales/en.ts @@ -201,6 +201,8 @@ export const en: Record = { 'admin.inspector.screen.claudeUsage.hint': 'Off for a new install. A dashboard that already showed the Claude widget before this setting existed keeps it on, so the gauges do not go blank on an upgrade. Once on, the server reads Claude Code’s OAuth token from the “Claude Code-credentials” keychain item and presents it to api.anthropic.com to get the account’s usage — nothing is sent anywhere else, and the token is never stored or logged. The endpoint is not documented by Anthropic and may disappear.', 'admin.inspector.screen.accountEmail': 'Show the account e-mail address', 'admin.inspector.screen.accountEmail.hint': 'Off by default. Widgets that show an account then get the plan and the sign-in method, never the e-mail address: the server leaves it out of what it sends. Once on, the address is sent to every widget that reads an account channel — a widget installed from the marketplace included — and appears on the screen.', + 'admin.inspector.screen.macmonTemperature': 'Read the CPU temperature with macmon', + 'admin.inspector.screen.macmonTemperature.hint': 'Off by default. macmon is a third-party open-source tool that Fremkit does not install. Install it yourself with brew install macmon. On Apple Silicon, the server runs only /opt/homebrew/bin/macmon or /usr/local/bin/macmon every 10 seconds for one sample. The reading stays on this Mac. If unavailable, Fremkit shows the system temperature when known.', 'admin.inspector.screen.navWidgets': 'Navigation bar widgets', 'admin.inspector.screen.navWidgets.hint': 'Drawn on either side of the dots, in this order.', 'admin.inspector.screen.navWidgets.slot.left': 'Left', diff --git a/ui/src/shared/locales/fr.ts b/ui/src/shared/locales/fr.ts index b8fd0a90..0af179ba 100644 --- a/ui/src/shared/locales/fr.ts +++ b/ui/src/shared/locales/fr.ts @@ -201,6 +201,8 @@ export const fr: Record = { 'admin.inspector.screen.claudeUsage.hint': 'Désactivé pour une nouvelle installation. Un tableau de bord qui affichait déjà le widget Claude avant l’existence de ce réglage le conserve activé, pour que les jauges ne se vident pas lors d’une mise à jour. Une fois activé, le serveur lit le jeton OAuth de Claude Code dans l’élément de trousseau « Claude Code-credentials » et le présente à api.anthropic.com pour obtenir la consommation du compte — rien n’est envoyé ailleurs, et le jeton n’est ni enregistré ni journalisé. Le point d’accès n’est pas documenté par Anthropic et peut disparaître.', 'admin.inspector.screen.accountEmail': 'Afficher l’adresse e-mail du compte', 'admin.inspector.screen.accountEmail.hint': 'Désactivé par défaut. Les widgets qui affichent un compte reçoivent alors le forfait et le mode de connexion, jamais l’adresse e-mail : le serveur la retire de ce qu’il envoie. Une fois activé, l’adresse est envoyée à chaque widget qui lit un canal de compte — y compris un widget installé depuis la marketplace — et apparaît à l’écran.', + 'admin.inspector.screen.macmonTemperature': 'Lire la température du CPU avec macmon', + 'admin.inspector.screen.macmonTemperature.hint': 'Désactivé par défaut. macmon est un outil tiers libre que Fremkit n’installe pas. Installez-le vous-même avec brew install macmon. Sur Apple Silicon, le serveur lance uniquement /opt/homebrew/bin/macmon ou /usr/local/bin/macmon toutes les 10 secondes pour une mesure. Celle-ci reste sur ce Mac. Si indisponible, Fremkit affiche la température système lorsqu’elle est connue.', 'admin.inspector.screen.navWidgets': 'Widgets de la barre', 'admin.inspector.screen.navWidgets.hint': 'Répartis de part et d’autre des pastilles, dans cet ordre.', 'admin.inspector.screen.navWidgets.slot.left': 'Gauche', diff --git a/ui/src/shared/types.ts b/ui/src/shared/types.ts index 7e849c81..166a646c 100644 --- a/ui/src/shared/types.ts +++ b/ui/src/shared/types.ts @@ -82,6 +82,8 @@ export interface Privacy { showAccountEmail: boolean codexAccount: boolean codexHistorySources: ('cli' | 'vscode' | 'exec' | 'appServer' | 'subAgent' | 'subAgentReview' | 'subAgentCompact' | 'subAgentThreadSpawn' | 'subAgentOther' | 'unknown')[] + /** Use the optional local macmon executable for Apple Silicon CPU temperature. */ + macmonTemperature: boolean } export interface Config { diff --git a/ui/test/marketplace-modal.test.ts b/ui/test/marketplace-modal.test.ts index 22b6575c..85a37e94 100644 --- a/ui/test/marketplace-modal.test.ts +++ b/ui/test/marketplace-modal.test.ts @@ -59,7 +59,7 @@ function config(): Config { version: 3, display: { cols: 64, rows: 16, cell: 40, autoCycleSeconds: 0 }, connections: [], secrets: { backend: 'file' }, locale: 'en', - privacy: { claudeAccountUsage: false, showAccountEmail: false, codexAccount: false, codexHistorySources: [] }, marketplace: { installed: {} }, + privacy: { claudeAccountUsage: false, showAccountEmail: false, codexAccount: false, codexHistorySources: [], macmonTemperature: false }, marketplace: { installed: {} }, pages: [{ id: 'home', name: 'Home', widgets: [] }], } as unknown as Config } diff --git a/ui/test/permissions-asks.test.ts b/ui/test/permissions-asks.test.ts index 0c8bc9bc..40537c0b 100644 --- a/ui/test/permissions-asks.test.ts +++ b/ui/test/permissions-asks.test.ts @@ -41,7 +41,7 @@ function config(): Config { version: 3, display: { cols: 64, rows: 16, cell: 40, autoCycleSeconds: 0 }, connections: [], secrets: { backend: 'file' }, locale: 'en', - privacy: { claudeAccountUsage: false, showAccountEmail: false, codexAccount: false, codexHistorySources: [] }, + privacy: { claudeAccountUsage: false, showAccountEmail: false, codexAccount: false, codexHistorySources: [], macmonTemperature: false }, marketplace: { installed: {} }, pages: [{ id: 'home', name: 'Home', diff --git a/ui/test/store.test.ts b/ui/test/store.test.ts index 7c7aba20..db9226a0 100644 --- a/ui/test/store.test.ts +++ b/ui/test/store.test.ts @@ -28,7 +28,7 @@ function config(): Config { display: { cols: 64, rows: 16, cell: 40, autoCycleSeconds: 0 }, connections: [], secrets: { backend: 'file' }, - privacy: { claudeAccountUsage: false, showAccountEmail: false, codexAccount: false, codexHistorySources: [] }, + privacy: { claudeAccountUsage: false, showAccountEmail: false, codexAccount: false, codexHistorySources: [], macmonTemperature: false }, pages: [{ id: 'home', name: 'Accueil', widgets: [ { instanceId: 'clock-1', widgetId: 'clock', x: 0, y: 0, w: 16, h: 4, showTitle: true, settings: {} }, ] }], diff --git a/ui/test/theme-repaint.test.ts b/ui/test/theme-repaint.test.ts index da5db7c4..3af9193c 100644 --- a/ui/test/theme-repaint.test.ts +++ b/ui/test/theme-repaint.test.ts @@ -18,7 +18,7 @@ function config(theme: string): Config { version: 3, display: { cols: 64, rows: 16, cell: 40, autoCycleSeconds: 0, theme }, connections: [], secrets: { backend: 'file' }, locale: 'en', - privacy: { claudeAccountUsage: false, showAccountEmail: false, codexAccount: false, codexHistorySources: [] }, marketplace: { installed: {} }, + privacy: { claudeAccountUsage: false, showAccountEmail: false, codexAccount: false, codexHistorySources: [], macmonTemperature: false }, marketplace: { installed: {} }, pages: [{ id: 'home', name: 'Home', widgets: [] }], } as unknown as Config } diff --git a/widgets/cpu/index.html b/widgets/cpu/index.html index 8ee6ed89..0b869b37 100644 --- a/widgets/cpu/index.html +++ b/widgets/cpu/index.html @@ -33,10 +33,17 @@ /* Right cluster: the bar pushes the iframe against the dots, so its content hugs that edge too. */ html.compact.slot-right .cwrap{align-items:flex-end;text-align:right} html.compact.slot-right .cbar{align-self:stretch} -
--%
+
--%
CPU --