diff options
| author | Adam Malczewski <[email protected]> | 2026-09-05 04:42:20 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-09-05 04:42:20 +0900 |
| commit | 5e5f02c67d0c165dd93f8277a3815d51a540d996 (patch) | |
| tree | 2b98579d25f3f16204feaf25ddac2746e4bbb934 /src/features/plugins/store.svelte.ts | |
| parent | 2f282f1a5c784dff97af7c936ccb43ca2b63f03f (diff) | |
| download | dispatch-web-5e5f02c67d0c165dd93f8277a3815d51a540d996.tar.gz dispatch-web-5e5f02c67d0c165dd93f8277a3815d51a540d996.zip | |
feat(layout): plan 03 — frontend plugin ABI + handshake + load lifecycle
Diffstat (limited to 'src/features/plugins/store.svelte.ts')
| -rw-r--r-- | src/features/plugins/store.svelte.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/features/plugins/store.svelte.ts b/src/features/plugins/store.svelte.ts index 580293e..fe48940 100644 --- a/src/features/plugins/store.svelte.ts +++ b/src/features/plugins/store.svelte.ts @@ -3,6 +3,7 @@ import type { SetWorkspacePluginStateRequest, WorkspacePluginRow, } from "@dispatch/transport-contract"; +import type { FrontendPluginState } from "../../core/plugin-abi"; import type { PluginOpResult, PluginScanResult, PluginsHttp } from "./adapter/http"; import type { PluginNode } from "./logic/types"; import { pluginNodes } from "./logic/view-model"; @@ -70,6 +71,16 @@ export interface PluginsStore { * connected client converges. Fire-and-forget. */ onExtensionsChanged(): void; + + /** + * The frontend-plugin (plan 03) per-plugin FE states — reported by the + * plugin host after every driver sync. Rendered by the manager rows: + * `incompatible` → "incompatible frontend plugin" (the backend-mismatch + * grammar), `failed` → the activation error. Absent = no FE section. + */ + readonly frontendStates: ReadonlyMap<string, FrontendPluginState>; + /** The plugin host's post-sync report (the only writer). */ + setFrontendStates(states: ReadonlyMap<string, FrontendPluginState>): void; } /** One open workspace modal's view (rows + materialized provider count). */ @@ -86,6 +97,7 @@ export function createPluginsStore(http: PluginsHttp): PluginsStore { let error = $state<string | null>(null); let lastScan = $state<PluginScanResult | null>(null); let workspaceView = $state<WorkspacePluginsView | null>(null); + let frontendStates = $state<ReadonlyMap<string, FrontendPluginState>>(new Map()); // Normalized nodes — derived so the graph logic re-runs only when the list // changes, not on every read. @@ -194,5 +206,13 @@ export function createPluginsStore(http: PluginsHttp): PluginsStore { const open = workspaceView?.workspaceId; if (open !== undefined) void this.openWorkspace(open); }, + + get frontendStates(): ReadonlyMap<string, FrontendPluginState> { + return frontendStates; + }, + + setFrontendStates(states: ReadonlyMap<string, FrontendPluginState>): void { + frontendStates = states; + }, }; } |
