nexus/ui/src/api/hardware.ts
Nexus Dev 519076771b feat(39-02): VoiceStep hardware-aware UI with conditional enable/skip
- Add VoiceCapability interface to ui/src/api/hardware.ts
- Export VoiceCapability type from useHardwareInfo.ts
- VoiceStep accepts voiceCapability prop, renders conditionally
- Insufficient hardware: shows capability note with skip-only button
- Binaries present: shows green checkmarks next to STT/TTS labels
- Missing binaries on sufficient hardware: shows install note, dimmed Enable
- NexusOnboardingWizard passes voiceCapability from hardware probe to VoiceStep
2026-04-04 03:35:46 +00:00

42 lines
1.1 KiB
TypeScript

// [nexus] Hardware detection and nexus settings API client
import { api } from "./client";
export type HardwareTier = "gpu" | "apple_silicon" | "cpu_only";
export interface VoiceCapability {
whisperAvailable: boolean;
piperAvailable: boolean;
voiceTierSufficient: boolean;
}
export interface HardwareInfo {
totalGb: number;
freeGb: number;
usableGb: number;
platform: string;
gpuName: string | null;
gpuVramGb: number | null;
unifiedMemory: boolean;
hardwareTier: HardwareTier;
cpuModel: string | null;
voiceCapability?: VoiceCapability;
}
export type NexusMode = "personal_ai" | "project_builder" | "both";
export interface NexusSettings {
mode: NexusMode;
voiceEnabled?: boolean;
}
export function fetchHardwareInfo(): Promise<HardwareInfo> {
return api.get<HardwareInfo>("/system/providers");
}
export function fetchNexusSettings(): Promise<NexusSettings> {
return api.get<NexusSettings>("/nexus/settings");
}
export function updateNexusSettings(settings: Partial<NexusSettings>): Promise<NexusSettings> {
return api.patch<NexusSettings>("/nexus/settings", settings);
}