- 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
35 lines
955 B
TypeScript
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);
|
|
}
|