- #310: horodatage de tous les messages et événements de conversation visibles — composant partagé EntryTimestamp, timestamps propagés dans le transcript chat, les annonces inter-agent et le viewer de conversation, normalisation côté domain/adapters (conversation_log, paginate). - #311: stop d'agent robuste pour PTY non monté, sessions headless et CLI custom — lifecycle/orchestrator durcis, ponts chat app-tauri/web-server alignés, arrêt fiable sans session orpheline. - #312: préférence globale d'interface terminal par défaut — nouveau store settings (domain/application/infrastructure + tests), DTO et commandes backend, adapter frontend userSettings, panneau TerminalSettings dans les paramètres globaux. - #313: Paramètres du projet — contexte de projet éditable et couleur de thème par projet (ProjectSettingsPanel + projectTheme), teinte des onglets projet, persistance via DTO projet. QA verte (GO QA sur feature/batch-310-311-312-313-chat-stop-prefs-theme) — vérifications Git: git diff --cached --check OK; staging borné à crates/ et frontend/ (74 fichiers, +2105/-531), commit unique de lot conforme à la convention des lots (précédents batch-151/158/159, batch-210/211/212) car les fichiers partagés (dto.rs, commands.rs, CustomAgentChatView) entrelacent les 4 tickets. fichiers .ideai/* (agents/test.md, chat-drafts.json, system-permissions.json, tickets/counter.json, tickets/index.json, tickets/308-313/), attachments/ et scripts/ hors périmètre et préservés en worktree ; aucun push. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
106 lines
3.3 KiB
TypeScript
106 lines
3.3 KiB
TypeScript
/**
|
|
* 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 {
|
|
OpenProjectRestoreState,
|
|
Project,
|
|
ProjectFileListing,
|
|
RemoveProjectOutput,
|
|
RestoreOpenProjectsOutput,
|
|
} from "@/domain";
|
|
import type { ProjectGateway, ProjectSettings } 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 });
|
|
}
|
|
|
|
removeProject(projectId: string): Promise<RemoveProjectOutput> {
|
|
return invoke<RemoveProjectOutput>("remove_project", {
|
|
request: { projectId },
|
|
});
|
|
}
|
|
|
|
restoreOpenProjects(): Promise<RestoreOpenProjectsOutput> {
|
|
return invoke<RestoreOpenProjectsOutput>("restore_open_projects");
|
|
}
|
|
|
|
retryOpenProjectRestore(projectId?: string): Promise<RestoreOpenProjectsOutput> {
|
|
return invoke<RestoreOpenProjectsOutput>("retry_open_project_restore", {
|
|
request: projectId === undefined ? {} : { projectId },
|
|
});
|
|
}
|
|
|
|
removeProjectFromRestore(projectId: string): Promise<OpenProjectRestoreState> {
|
|
return invoke<OpenProjectRestoreState>("remove_project_from_restore", {
|
|
request: { projectId },
|
|
});
|
|
}
|
|
|
|
saveOpenProjectRestoreOrder(
|
|
orderedProjectIds: string[],
|
|
): Promise<OpenProjectRestoreState> {
|
|
return invoke<OpenProjectRestoreState>("save_open_project_restore_order", {
|
|
request: { orderedProjectIds },
|
|
});
|
|
}
|
|
|
|
readOpenProjectRestoreState(): Promise<OpenProjectRestoreState> {
|
|
return invoke<OpenProjectRestoreState>("read_open_project_restore_state");
|
|
}
|
|
|
|
readProjectContext(projectId: string): Promise<string> {
|
|
return invoke<string>("read_project_context", { projectId });
|
|
}
|
|
|
|
async updateProjectContext(projectId: string, content: string): Promise<void> {
|
|
await invoke("update_project_context", {
|
|
request: { projectId, content },
|
|
});
|
|
}
|
|
|
|
readProjectSettings(projectId: string): Promise<ProjectSettings> {
|
|
return invoke<ProjectSettings>("read_project_settings", { projectId });
|
|
}
|
|
|
|
updateProjectSettings(
|
|
projectId: string,
|
|
settings: ProjectSettings,
|
|
): Promise<ProjectSettings> {
|
|
return invoke<ProjectSettings>("update_project_settings", {
|
|
request: { projectId, themeColor: settings.themeColor },
|
|
});
|
|
}
|
|
|
|
async listProjectFiles(): Promise<ProjectFileListing> {
|
|
throw new Error("Project files browsing is available in the web workspace only.");
|
|
}
|
|
|
|
async downloadProjectFile(): Promise<void> {
|
|
throw new Error("Project file download is available in the web workspace only.");
|
|
}
|
|
|
|
async downloadProjectDirectory(): Promise<void> {
|
|
throw new Error("Project directory download is available in the web workspace only.");
|
|
}
|
|
}
|