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:
30
frontend/src/adapters/project.ts
Normal file
30
frontend/src/adapters/project.ts
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Tauri adapter for {@link ProjectGateway} (L2). Together with the sibling
|
||||
* adapters this is the *only* place 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 { Project } from "@/domain";
|
||||
import type { ProjectGateway } from "@/ports";
|
||||
|
||||
export class TauriProjectGateway implements ProjectGateway {
|
||||
listProjects(): Promise<Project[]> {
|
||||
return invoke<Project[]>("list_projects");
|
||||
}
|
||||
|
||||
createProject(name: string, root: string): Promise<Project> {
|
||||
return invoke<Project>("create_project", { request: { name, root } });
|
||||
}
|
||||
|
||||
openProject(projectId: string): Promise<Project> {
|
||||
return invoke<Project>("open_project", { projectId });
|
||||
}
|
||||
|
||||
async closeProject(projectId: string): Promise<void> {
|
||||
await invoke("close_project", { projectId });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user