Files
IdeA/frontend/src/adapters/index.ts
Blomios 3f1e132e88 feat(frontend): écran Appareils et parcours d'appairage nommé (#77 F1/F2)
Expose la gestion des appareils appairés introduite en B1-B4, sur une
surface unique partagée par le web et le desktop.

- Écran Appareils : liste, renommage, révocation unitaire ou globale,
  activité formatée, panneau de code éphémère.
- Le parcours d'appairage demande un nom d'appareil, pour qu'une
  révocation porte sur quelque chose d'identifiable par l'utilisateur.
- Gateways DeviceGateway en trois adapters (Tauri, HTTP, Mock), le port
  restant le seul contrat connu de la feature.

Les erreurs sont mappées localement et le message du serveur n'est jamais
affiché tel quel : un échec d'appairage ne doit pas devenir un oracle pour
qui teste des codes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 13:27:06 +02:00

105 lines
3.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* Real Tauri adapters wiring the UI ports to the backend via `@tauri-apps/api`.
*
* Only {@link TauriSystemGateway} is fully wired in L1 (to the `health`
* command). The remaining gateways are skeletons that throw `NOT_IMPLEMENTED`
* until their lots (L2L9) land — they exist so the DI surface is complete and
* the app can run real-mode without the mock substituting everything.
*/
import type { GatewayError } from "@/domain";
import type {
Gateways,
RemoteGateway,
} from "@/ports";
import { TauriSystemGateway } from "./system";
import { TauriAgentGateway } from "./agent";
import { TauriInputGateway } from "./input";
import { TauriProjectGateway } from "./project";
import { TauriTerminalGateway } from "./terminal";
import { TauriLayoutGateway } from "./layout";
import { TauriProfileGateway } from "./profile";
import { TauriModelServerGateway } from "./modelServer";
import { TauriDesktopServerGateway } from "./desktopServer";
import { TauriTemplateGateway } from "./template";
import { TauriSkillGateway } from "./skill";
import { TauriMemoryGateway } from "./memory";
import { TauriEmbedderGateway } from "./embedder";
import { TauriDeviceGateway } from "./device";
import { TauriGitGateway } from "./git";
import { TauriPermissionGateway } from "./permission";
import { TauriWorkStateGateway } from "./workState";
import { TauriConversationGateway } from "./conversation";
import { TauriTicketGateway } from "./ticket";
import { TauriWindowGateway } from "./window";
import { TauriFocusedProjectGateway } from "./focusedProject";
import { LocalStorageUiPreferencesGateway } from "./uiPreferences";
function notImplemented(what: string): never {
const err: GatewayError = {
code: "NOT_IMPLEMENTED",
message: `${what} is not implemented yet (pending its lot).`,
};
throw err;
}
class TauriRemoteGateway implements RemoteGateway {
connect(): Promise<void> {
return notImplemented("RemoteGateway.connect");
}
}
/** Builds the full set of real Tauri-backed gateways. */
export function createTauriGateways(): Gateways {
return {
system: new TauriSystemGateway(),
agent: new TauriAgentGateway(),
input: new TauriInputGateway(),
terminal: new TauriTerminalGateway(),
project: new TauriProjectGateway(),
layout: new TauriLayoutGateway(),
git: new TauriGitGateway(),
remote: new TauriRemoteGateway(),
profile: new TauriProfileGateway(),
modelServer: new TauriModelServerGateway(),
desktopServer: new TauriDesktopServerGateway(),
template: new TauriTemplateGateway(),
skill: new TauriSkillGateway(),
memory: new TauriMemoryGateway(),
embedder: new TauriEmbedderGateway(),
device: new TauriDeviceGateway(),
permission: new TauriPermissionGateway(),
workState: new TauriWorkStateGateway(),
conversation: new TauriConversationGateway(),
ticket: new TauriTicketGateway(),
window: new TauriWindowGateway(),
focusedProject: new TauriFocusedProjectGateway(),
uiPreferences: new LocalStorageUiPreferencesGateway(),
};
}
export {
TauriSystemGateway,
TauriAgentGateway,
TauriInputGateway,
TauriProjectGateway,
TauriTerminalGateway,
TauriLayoutGateway,
TauriProfileGateway,
TauriModelServerGateway,
TauriDesktopServerGateway,
TauriTemplateGateway,
TauriSkillGateway,
TauriMemoryGateway,
TauriEmbedderGateway,
TauriDeviceGateway,
TauriGitGateway,
TauriPermissionGateway,
TauriWorkStateGateway,
TauriConversationGateway,
TauriTicketGateway,
TauriWindowGateway,
TauriFocusedProjectGateway,
LocalStorageUiPreferencesGateway,
};