Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## Unreleased — desktop serving wording

- Use one verb for putting a Mac to work across the desktop app: Home, This Mac, the menu bar, Overview next steps, Updates and Settings now say Start serving, Stop serving and Restart serving instead of mixing Start providing, Stop provider, Start provider, contributing and Keep providing. The menu bar shows Serving, Stopped, Starting…, Finishing requests or Connecting… instead of the raw runtime state.

## Unreleased — desktop serving wording

- Use one verb for putting a Mac to work across the desktop app: Home, This Mac, the menu bar, Overview next steps, Updates and Settings now say Start serving, Stop serving and Restart serving instead of mixing Start providing, Stop provider, Start provider, contributing and Keep providing. The menu bar shows Serving, Stopped, Starting…, Finishing requests or Connecting… instead of the raw runtime state.

## Unreleased — desktop hardware load

- Serve real whole-machine load to the desktop app over the authenticated loopback control API: per-core CPU load with the chip's tier and cluster layout (including M5 Super cores), GPU utilization and memory, ANE activity, memory use and pressure, thermal state, and Darkbloom's share of GPU time. Sampling runs in the desktop API process only while the app is looking, without root, and never reaches heartbeats, logs or the coordinator.
Expand Down
36 changes: 10 additions & 26 deletions desktop-app/src/main/tray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'node:path';
import type { Route } from '../shared/contracts';
import type { Backend } from './backend';
import { quit } from './lifecycle';
import { startableModels, trayMenuUpdater } from './trayMenu';
import { startableModels, trayMenuTemplate, trayMenuUpdater } from './trayMenu';

// Creates the menu bar item. Returns the snapshot listener that rebuilds the
// native menu only when its visible model changes.
Expand All @@ -15,40 +15,24 @@ export function createTray(backend: Backend, show: (route?: Route) => void) {
const update = trayMenuUpdater((model) => {
tray.setToolTip(`Darkbloom · ${model.status}`);
tray.setContextMenu(
Menu.buildFromTemplate([
{ label: `Darkbloom — ${model.status}`, enabled: false },
{ label: 'Open Darkbloom', click: () => show() },
{ label: 'Models', click: () => show('models') },
{ label: 'Studio', click: () => show('studio') },
{ label: 'Earnings', click: () => show('earnings') },
{ type: 'separator' },
{
label: 'Start provider',
enabled: model.canStart,
click: () => {
Menu.buildFromTemplate(
trayMenuTemplate(model, {
show,
start: () => {
const models = startableModels(backend.snapshot);
if (models.length)
void backend.act({ action: 'start', models }).catch(() => show('models'));
else show('models');
},
},
{
label: 'Stop provider',
enabled: model.canStop,
click: () => {
stop: () => {
void backend.act({ action: 'stop' }).catch(() => show());
},
},
{
label: 'Restart provider',
enabled: model.canRestart,
click: () => {
restart: () => {
void backend.act({ action: 'restart' }).catch(() => show());
},
},
{ type: 'separator' },
{ label: 'Quit Darkbloom', click: quit },
]),
quit,
}),
),
);
});
update(backend.snapshot);
Expand Down
51 changes: 49 additions & 2 deletions desktop-app/src/main/trayMenu.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Snapshot } from '../shared/contracts';
import type { MenuItemConstructorOptions } from 'electron';
import type { Route, Snapshot } from '../shared/contracts';

// Everything the tray menu shows that depends on provider state. Snapshots
// arrive every couple of seconds; the native menu is rebuilt only when this
Expand All @@ -15,13 +16,59 @@ export function trayMenuModel(state: Snapshot | undefined): TrayMenuModel {
state?.state === 'running' &&
!state.operations.some((operation) => operation.state === 'running');
return {
status: state?.state || 'Connecting',
status: trayStatus(state?.state),
canStart: state?.state === 'stopped',
canStop: idle,
canRestart: idle,
};
}

// The same words as Home and This Mac: the act is serving, and its status is named for people,
// not echoed from the protocol.
export function trayStatus(state: Snapshot['state'] | undefined): string {
switch (state) {
case 'running':
return 'Serving';
case 'stopped':
return 'Stopped';
case 'starting':
return 'Starting…';
case 'draining':
return 'Finishing requests';
case 'stale':
return 'Status unavailable';
default:
return 'Connecting…';
}
}

export interface TrayMenuActions {
show: (route?: Route) => void;
start: () => void;
stop: () => void;
restart: () => void;
quit: () => void;
}

export function trayMenuTemplate(
model: TrayMenuModel,
actions: TrayMenuActions,
): MenuItemConstructorOptions[] {
return [
{ label: `Darkbloom — ${model.status}`, enabled: false },
{ label: 'Open Darkbloom', click: () => actions.show() },
{ label: 'Models', click: () => actions.show('models') },
{ label: 'Studio', click: () => actions.show('studio') },
{ label: 'Earnings', click: () => actions.show('earnings') },
{ type: 'separator' },
{ label: 'Start serving', enabled: model.canStart, click: actions.start },
{ label: 'Stop serving', enabled: model.canStop, click: actions.stop },
{ label: 'Restart serving', enabled: model.canRestart, click: actions.restart },
{ type: 'separator' },
{ label: 'Quit Darkbloom', click: actions.quit },
];
}

export function sameTrayMenu(a: TrayMenuModel, b: TrayMenuModel) {
return (
a.status === b.status &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export type ContributionMode = 'network' | 'local';
const modes: { id: ContributionMode; title: string; description: string }[] = [
{
id: 'network',
title: 'Contribute to Darkbloom',
title: 'Serve the Darkbloom network',
description: 'Make this Mac available and earn from its work.',
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function RuntimeSetup({ backend }: { backend: BackendState }) {
<h2>{missing ? 'Install Darkbloom to check this Mac.' : 'We couldn’t check this Mac.'}</h2>
<p>
{missing
? 'Darkbloom installs its verified native runtime, then checks whether this Mac can serve models. Your provider works independently of this window.'
? 'Darkbloom installs its verified native runtime, then checks whether this Mac can serve models. Serving continues when this window is closed.'
: 'Darkbloom couldn’t reach its native runtime. Repair it and the check runs again.'}
</p>
{error && <Notice>{error}</Notice>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const idle: Phase = { name: 'idle' };
// A start may download its models first.
const startTimeoutMs = 40 * 60_000;

// Contributing needs a linked account, so an unlinked Mac links first and starts the moment the
// Serving needs a linked account, so an unlinked Mac links first and starts the moment the
// account is linked. A runtime that rejects Autopilot by name leaves `rejected` set so the page
// can offer the plain start instead.
export function useStartServing(backend: BackendState, done: () => void, onRejected: () => void) {
Expand Down
6 changes: 3 additions & 3 deletions desktop-app/src/renderer/components/operations/labels.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Action, Operation } from '../../../shared/contracts';

const actions: Record<Action['action'], { name: string; running: string }> = {
start: { name: 'Provider start', running: 'Starting provider' },
stop: { name: 'Provider stop', running: 'Stopping provider' },
restart: { name: 'Provider restart', running: 'Restarting provider' },
start: { name: 'Start serving', running: 'Starting to serve' },
stop: { name: 'Stop serving', running: 'Stopping serving' },
restart: { name: 'Restart serving', running: 'Restarting serving' },
switch: { name: 'Model selection', running: 'Changing models' },
update: { name: 'Darkbloom update', running: 'Updating Darkbloom' },
diagnose: { name: 'Health check', running: 'Checking this Mac' },
Expand Down
2 changes: 1 addition & 1 deletion desktop-app/src/renderer/features/Cooling.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function Cooling({
<strong>
{cooling?.temperature == null ? '—' : `${Math.round(cooling.temperature)}°`}
</strong>
<p>Cooling returns to macOS control when the provider stops.</p>
<p>Cooling returns to macOS control when serving stops.</p>
</div>
{fans.length > 0 && <FanCards fans={fans} />}
</div>
Expand Down
2 changes: 1 addition & 1 deletion desktop-app/src/renderer/features/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function Home({
onClick={() => (running ? void backend.act({ action: 'stop' }) : navigate('models'))}
>
{running ? <Pause size={14} /> : <Play size={14} />}{' '}
{running ? 'Stop provider' : 'Start providing'}
{running ? 'Stop serving' : 'Start serving'}
</Button>
}
/>
Expand Down
2 changes: 1 addition & 1 deletion desktop-app/src/renderer/features/Leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function Leaderboard({ backend }: { backend: BackendState }) {
<Header title="Leaderboard" description="The people powering Darkbloom." />
<NetworkMap network={backend.network} />
<div className={styles.heading}>
<h2>Top contributors</h2>
<h2>Top providers</h2>
<span>Annualized earnings · past 24 hours</span>
</div>
{backend.leaderError && (
Expand Down
4 changes: 2 additions & 2 deletions desktop-app/src/renderer/features/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export function Settings({
<AutoUpdateSwitch checked={auto} onChange={setAuto} disabled={backend.busy} />
<div className="setting-row">
<span>
<strong>Keep providing in the background</strong>
<small>Closing the window keeps the menu bar and provider available.</small>
<strong>Keep serving in the background</strong>
<small>Closing the window keeps Darkbloom in the menu bar and this Mac serving.</small>
</span>
<Status state="online">Always available</Status>
</div>
Expand Down
2 changes: 1 addition & 1 deletion desktop-app/src/renderer/features/Studio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function Studio({
onChange={() => setMode('combined')}
/>
<strong>Alongside the network</strong>
<span>Reuse models while contributing to Darkbloom.</span>
<span>Reuse models while serving the Darkbloom network.</span>
</label>
<label className={mode === 'local' ? 'selected' : ''}>
<input
Expand Down
10 changes: 5 additions & 5 deletions desktop-app/src/renderer/features/Updates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function Updates({ backend }: { backend: BackendState }) {
<>
<Header
title="Updates"
description="Stay current. Keep contributing."
description="Stay current. Keep serving."
action={
<Button
disabled={checking}
Expand Down Expand Up @@ -90,18 +90,18 @@ export function Updates({ backend }: { backend: BackendState }) {
onChange={(value) => void changeAuto(value)}
/>
<small className={styles.muted}>
Preference changes apply on the next provider restart.
Preference changes apply the next time serving restarts.
</small>
{restartNeeded && (
<div className={styles.restart} role="status">
<span>Saved. Restart the provider to apply.</span>
<span>Saved. Restart serving to apply.</span>
<Button
disabled={backend.busy}
onClick={async () => {
if (await backend.act({ action: 'restart' }, true)) setRestartNeeded(false);
}}
>
Restart provider
Restart serving
</Button>
</div>
)}
Expand Down Expand Up @@ -134,7 +134,7 @@ export function Updates({ backend }: { backend: BackendState }) {
>
Restart desktop app
</Button>
<small>Your provider keeps running.</small>
<small>This Mac keeps serving.</small>
</>
)}
</section>
Expand Down
4 changes: 2 additions & 2 deletions desktop-app/src/renderer/features/cooling/CoolingControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function CoolingControls({ backend }: { backend: BackendState }) {
}, [backend.cooling?.speed, backend.cooling?.threshold]);
return (
<section className={styles.controls} aria-labelledby={titleID}>
<h2 id={titleID}>Provider cooling</h2>
<h2 id={titleID}>Cooling while serving</h2>
<div className={styles.fields}>
<label className={styles.field}>
<span>
Expand Down Expand Up @@ -44,7 +44,7 @@ export function CoolingControls({ backend }: { backend: BackendState }) {
</option>
))}
</select>
<small>Only while the provider is active.</small>
<small>Only while this Mac is serving.</small>
</label>
</div>
<div className={styles.actions}>
Expand Down
6 changes: 3 additions & 3 deletions desktop-app/src/renderer/features/home/chip/stageText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ function modeText(
fresh: boolean,
) {
if (measured) return 'Live from this Mac';
if (provider === 'stopped') return 'Provider stopped';
if (provider === 'starting') return 'Provider starting';
if (provider === 'stopped') return 'Stopped';
if (provider === 'starting') return 'Starting…';
if (preview) return 'Simulated activity';
return fresh ? 'Live from this Mac' : 'Waiting for live activity';
}
Expand Down Expand Up @@ -58,7 +58,7 @@ export function stageText({
const names = memory.models.map((model) => model.name);
const machine = measured ? ` GPU ${measured.gpu} busy.` : '';
const summary = !powered
? `${anatomy.name}: provider ${provider === 'starting' ? 'starting' : 'stopped'}.${machine}`
? `${anatomy.name}: ${provider === 'starting' ? 'starting to serve' : 'not serving'}.${machine}`
: `${anatomy.name}: ${preview ? PHASE_TEXT[stats.phase].toLowerCase() : 'live activity'}. ${
running === null
? ''
Expand Down
2 changes: 1 addition & 1 deletion desktop-app/src/renderer/features/insights/LiveModels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export function LiveModels({ state }: { state: Snapshot }) {
{models.length === 0 && (
<p className={styles.empty}>
{state.state === 'stopped'
? 'Start providing to see your models working.'
? 'Start serving to see your models working.'
: stale
? 'Waiting for model activity.'
: 'No models are currently loaded.'}
Expand Down
8 changes: 4 additions & 4 deletions desktop-app/src/renderer/features/machines/MachineHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ export function MachineHeader({
>
{state.state === 'running' ? <Square size={12} /> : <Play size={13} />}{' '}
{state.state === 'running'
? 'Stop provider'
? 'Stop serving'
: state.state === 'draining'
? 'Finishing requests'
: 'Start provider'}
: 'Start serving'}
</Button>
<Button
title="Restart provider"
aria-label="Restart"
title="Restart serving"
aria-label="Restart serving"
disabled={backend.busy}
onClick={() => void backend.act({ action: 'restart' })}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function MemoryHealth({ memory }: { memory: Snapshot['memory'] }) {
{free != null && <span>{gb(free)} free to load</span>}
</>
) : (
'Reported while the provider runs.'
'Reported while this Mac is serving.'
)}
</small>
</div>
Expand Down
Loading
Loading