nexus/ui/src/api/hardware.ts
Nexus Dev 0d318a31d3 feat(34-01): register chatFileRoutes + nexusSettingsRoutes in app.ts, add voiceEnabled to nexus-settings
- Add chatFileRoutes(db, storageService) after assistantHandoffRoutes (inside boardMutationGuard)
- Add nexusSettingsRoutes() after chatFileRoutes
- Extend nexusSettingsSchema with voiceEnabled: z.boolean().default(false)
- Update default return values in nexusSettingsService.get() to include voiceEnabled: false
- Add voiceEnabled?: boolean to NexusSettings client interface in hardware.ts
2026-04-03 22:33:43 +00:00

35 lines
955 B
TypeScript

// [nexus] Hardware detection and nexus settings API client
import { api } from "./client";
export type HardwareTier = "gpu" | "apple_silicon" | "cpu_only";
export interface HardwareInfo {
totalGb: number;
freeGb: number;
usableGb: number;
platform: string;
gpuName: string | null;
gpuVramGb: number | null;
unifiedMemory: boolean;
hardwareTier: HardwareTier;
cpuModel: string | null;
}
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);
}