feat(frontend): host les fenêtres plugin et l'API publique windows.open

Ajoute la vue window host qui charge le layout plugin dans une fenêtre OS
détachée, expose react/react-dom/jsx-runtime hébergés sous
frontend/public/plugin-host pour que le runtime SDK y résolve React, et
câble services.windows.open() côté runtime plugin (loader/services/registry).

npm test -- --run src/adapters/window.test.ts src/app/ViewWindow.test.tsx
  src/plugins/runtime/loader.test.ts src/plugins/runtime/services.test.ts : 39/39
npm run typecheck : OK
npm run build : OK

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-04 00:39:50 +02:00
parent 551eb09ad2
commit d8df466fba
20 changed files with 678 additions and 10 deletions

View File

@ -1271,6 +1271,25 @@ export interface ViewWindowSnapshot {
visible: boolean;
}
export interface PluginLayoutWindowOpenInput {
pluginId: string;
layoutType: string;
state?: JsonValue;
}
export interface PluginLayoutWindowOpenResult {
label: string;
url: string;
alreadyOpen: boolean;
providerPluginDisplayName: string;
layoutLabel: string;
surface: {
pluginId: string;
layoutType: string;
state: JsonValue;
};
}
/**
* Detaching a View into its own OS window (ticket #23, reworked in #47).
*
@ -1290,6 +1309,15 @@ export interface WindowGateway {
* main window's focused project; no project id is passed.
*/
openViewWindow(panel: string): Promise<void>;
/**
* Opens — or focuses, if already open — a separate OS window rendering one
* plugin layout contribution declared in the provider plugin's
* `contributes.layouts`. The backend validates the provider is runtime-active
* and the layout type is declared before creating the window.
*/
openPluginLayoutWindow(
input: PluginLayoutWindowOpenInput,
): Promise<PluginLayoutWindowOpenResult>;
/** Closes the detached window for `panel` if one is open. */
closeViewWindow(panel: string): Promise<void>;
/**