feat: add main features
Agents for developpement added + frontend add + backend added. Git viewer created + agent and template creator + layout and project creator
This commit is contained in:
46
frontend/src/adapters/profile.ts
Normal file
46
frontend/src/adapters/profile.ts
Normal file
@ -0,0 +1,46 @@
|
||||
/**
|
||||
* 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<FirstRunState> {
|
||||
return invoke<FirstRunState>("first_run_state");
|
||||
}
|
||||
|
||||
referenceProfiles(): Promise<AgentProfile[]> {
|
||||
return invoke<AgentProfile[]>("reference_profiles");
|
||||
}
|
||||
|
||||
detectProfiles(candidates: AgentProfile[]): Promise<ProfileAvailability[]> {
|
||||
return invoke<ProfileAvailability[]>("detect_profiles", {
|
||||
request: { candidates },
|
||||
});
|
||||
}
|
||||
|
||||
listProfiles(): Promise<AgentProfile[]> {
|
||||
return invoke<AgentProfile[]>("list_profiles");
|
||||
}
|
||||
|
||||
saveProfile(profile: AgentProfile): Promise<AgentProfile> {
|
||||
return invoke<AgentProfile>("save_profile", { request: { profile } });
|
||||
}
|
||||
|
||||
async deleteProfile(profileId: string): Promise<void> {
|
||||
await invoke("delete_profile", { profileId });
|
||||
}
|
||||
|
||||
configureProfiles(profiles: AgentProfile[]): Promise<AgentProfile[]> {
|
||||
return invoke<AgentProfile[]>("configure_profiles", {
|
||||
request: { profiles },
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user