Frontend pur, lecture seule, consomme read_conversation_page (LS6) ; aucun changement backend. - adapters : conversation.ts (gateway) + conversationNormalization.ts. - features/conversations : useConversationThread, ConversationViewer, index. - domain (types LS7), ports (port + Gateways.conversation), adapters/index, mock (+ clé inventaire). - features/workstate : ProjectWorkStatePanel prop onOpenConversation. - features/projects : ProjectsView swap viewer. - tests (QA, verts) : conversationNormalization, mock/conversationGateway, useConversationThread, ConversationViewer, ProjectsView.ls7. tsc 0, vitest 443/443 (+36). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
84 lines
2.6 KiB
TypeScript
84 lines
2.6 KiB
TypeScript
/**
|
||
* 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 (L2–L9) 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 { TauriTemplateGateway } from "./template";
|
||
import { TauriSkillGateway } from "./skill";
|
||
import { TauriMemoryGateway } from "./memory";
|
||
import { TauriEmbedderGateway } from "./embedder";
|
||
import { TauriGitGateway } from "./git";
|
||
import { TauriPermissionGateway } from "./permission";
|
||
import { TauriWorkStateGateway } from "./workState";
|
||
import { TauriConversationGateway } from "./conversation";
|
||
|
||
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(),
|
||
template: new TauriTemplateGateway(),
|
||
skill: new TauriSkillGateway(),
|
||
memory: new TauriMemoryGateway(),
|
||
embedder: new TauriEmbedderGateway(),
|
||
permission: new TauriPermissionGateway(),
|
||
workState: new TauriWorkStateGateway(),
|
||
conversation: new TauriConversationGateway(),
|
||
};
|
||
}
|
||
|
||
export {
|
||
TauriSystemGateway,
|
||
TauriAgentGateway,
|
||
TauriInputGateway,
|
||
TauriProjectGateway,
|
||
TauriTerminalGateway,
|
||
TauriLayoutGateway,
|
||
TauriProfileGateway,
|
||
TauriTemplateGateway,
|
||
TauriSkillGateway,
|
||
TauriMemoryGateway,
|
||
TauriEmbedderGateway,
|
||
TauriGitGateway,
|
||
TauriPermissionGateway,
|
||
TauriWorkStateGateway,
|
||
TauriConversationGateway,
|
||
};
|