/** * Tauri adapter for {@link ProfileGateway} (L5). Like the sibling adapters this * is one of the *only* places that calls `invoke()`; components reach it * exclusively through the port. * * Commands and payload keys are camelCase, matching the backend DTO convention. */ import { invoke } from "@tauri-apps/api/core"; import type { AgentProfile, FirstRunState, ProfileAvailability } from "@/domain"; import type { ProfileGateway } from "@/ports"; export class TauriProfileGateway implements ProfileGateway { firstRunState(): Promise { return invoke("first_run_state"); } referenceProfiles(): Promise { return invoke("reference_profiles"); } detectProfiles(candidates: AgentProfile[]): Promise { return invoke("detect_profiles", { request: { candidates }, }); } listProfiles(): Promise { return invoke("list_profiles"); } saveProfile(profile: AgentProfile): Promise { return invoke("save_profile", { request: { profile } }); } async deleteProfile(profileId: string): Promise { await invoke("delete_profile", { profileId }); } configureProfiles(profiles: AgentProfile[]): Promise { return invoke("configure_profiles", { request: { profiles }, }); } }