@agimon-ai/po-web-dashboard 0.0.0-alpha.141 → 0.0.0-alpha.142

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,7 @@ function parseDashboardTileData(input) {
21
21
  if (data.column !== void 0 && data.column !== "main" && data.column !== "side") return null;
22
22
  if (data.icon !== void 0 && typeof data.icon !== "function" && (typeof data.icon !== "object" || data.icon === null)) return null;
23
23
  if (data.combinesComputers !== void 0 && typeof data.combinesComputers !== "boolean") return null;
24
+ if (data.dataScope !== void 0 && data.dataScope !== "host" && data.dataScope !== "global") return null;
24
25
  if (data.surfaces !== void 0 && (!Array.isArray(data.surfaces) || data.surfaces.some((surface) => surface !== "home" && surface !== "workspace"))) return null;
25
26
  if (data.open !== void 0) {
26
27
  if (typeof data.open !== "object" || data.open === null || Array.isArray(data.open)) return null;
@@ -1 +1 @@
1
- {"version":3,"file":"pluginRegistry.cjs","names":["HOST_SLOTS","collectWebTemplates","mergeScopedPlugins","collectNativeTemplates","collectPluginThemes","pluginsAtScope","qualifyHostId","leaderConflicts","parseHomeContribution","activityGroupSlot","isSelfHostShell","splitHostId"],"sources":["../../../src/web/lib/pluginRegistry.ts"],"sourcesContent":["import type {\n ActivityGroupContribution,\n ContextActionContribution,\n DashboardTileData,\n DockFaceContribution,\n FileLinkSource,\n LeaderBindingContribution,\n MinorModeContribution,\n PaletteCommandContribution,\n RepositorySettingsPanelContribution,\n SettingsPanelContribution,\n SettingsSectionContribution,\n SelectionAxisContribution,\n SessionChannelContribution,\n SlotDeclaration,\n SlotFillContribution,\n SurfaceContribution,\n TabContribution,\n ToolRendererContribution,\n UserMessageActionContribution,\n WebPluginDefinition,\n WebPluginMount,\n WebPluginRuntime,\n WebPluginSlotProps,\n} from '@agimon-ai/po-core/web';\nimport { activityGroupSlot, HOST_SLOTS, parseHomeContribution, type HomeContribution } from '@agimon-ai/po-core/web';\nexport { activityGroupSlot, HOST_SLOTS } from '@agimon-ai/po-core/web';\nimport type { ComponentType, ReactNode } from 'react';\n\nimport { qualifyHostId, splitHostId } from './hostIdentity';\nimport { leaderConflicts } from './leaderTree';\nimport { mergeScopedPlugins, pluginsAtScope } from './pluginScopes';\nimport { collectPluginThemes, type InstalledPluginTheme } from './pluginThemes';\nimport { isSelfHostShell } from './selfHostShell';\nimport {\n collectNativeTemplates,\n collectWebTemplates,\n type NativeTemplateCatalog,\n type WebTemplateCatalog,\n} from './templateCatalog';\nimport { noteStoreUpdate } from './uiTrace';\n\n/**\n * The installed plugin set.\n *\n * Plain module state rather than a reactive store: the generated plugin list\n * is installed once at startup, before the first render, so every read during\n * render is stable. Install runs in two phases. The first collects every\n * plugin's contributions in the generated order, which is (registrationOrder,\n * pluginId); the second resolves every relation between plugins by name, so\n * a plugin may fill a slot whichever of the two installs first.\n *\n * Plugins are independent and a user may install any of them, so a collision\n * between two plugins never fails the install: a shared name goes to the\n * first plugin (a Leader Space leaf to the later one, as the TUI documents)\n * and the loser is recorded as a diagnostic. Only a malformed contribution\n * inside one plugin throws, because that is a developer error its own tests\n * catch. resetWebPlugins exists for unit tests only.\n */\n\nexport type InstallDiagnosticKind =\n | 'duplicate-plugin'\n | 'duplicate-tab'\n | 'duplicate-dock-face'\n | 'duplicate-channel'\n | 'duplicate-tool'\n | 'duplicate-activity-group'\n | 'duplicate-minor-mode'\n | 'duplicate-selection-axis'\n | 'duplicate-palette-command'\n | 'duplicate-settings-section'\n | 'leader-leaf-override'\n | 'leader-group-label'\n | 'orphan-fill'\n | 'rejected-fill'\n | 'rejected-theme'\n | 'duplicate-theme'\n | 'invalid-template'\n | 'duplicate-template'\n | 'slot-load-failed'\n | 'start-failed'\n | 'invalid-plugin';\n\nexport interface InstallDiagnostic {\n /** The plugin that lost or misfiled the contribution. */\n pluginId: string;\n kind: InstallDiagnosticKind;\n message: string;\n}\n\n/** One placed fill, as the owner's renderSlot and slotData read it. */\nexport interface ResolvedFill {\n slot: string;\n pluginId: string;\n id: string;\n order: number;\n data?: unknown;\n component?: ComponentType<WebPluginSlotProps>;\n}\n\nexport interface InstalledDashboardTile extends ResolvedFill {\n data: DashboardTileData;\n}\n\n/** Reject malformed tile presentation without executing its body. */\nexport function parseDashboardTileData(input: unknown): DashboardTileData | null {\n if (typeof input !== 'object' || input === null || Array.isArray(input)) return null;\n const data = input as Record<string, unknown>;\n if (data.version !== 1 || typeof data.title !== 'string' || data.title.trim() === '') return null;\n if (data.size !== undefined && !['small', 'wide', 'tall', 'large'].includes(data.size as string)) return null;\n if (data.column !== undefined && data.column !== 'main' && data.column !== 'side') return null;\n if (\n data.icon !== undefined &&\n typeof data.icon !== 'function' &&\n (typeof data.icon !== 'object' || data.icon === null)\n )\n return null;\n if (data.combinesComputers !== undefined && typeof data.combinesComputers !== 'boolean') return null;\n if (\n data.surfaces !== undefined &&\n (!Array.isArray(data.surfaces) || data.surfaces.some((surface) => surface !== 'home' && surface !== 'workspace'))\n )\n return null;\n if (data.open !== undefined) {\n if (typeof data.open !== 'object' || data.open === null || Array.isArray(data.open)) return null;\n const open = data.open as Record<string, unknown>;\n if ((open.kind !== 'page' && open.kind !== 'settings') || typeof open.id !== 'string' || open.id.trim() === '')\n return null;\n }\n return input as DashboardTileData;\n}\n\nexport interface InstalledContextAction extends ContextActionContribution {\n pluginId: string;\n}\n\nexport interface InstalledUserMessageAction extends UserMessageActionContribution {\n pluginId: string;\n}\n\nconst SLOT_SEPARATOR = '.';\nconst DEFAULT_FILL_ORDER = 1000;\nconst RESERVED_PLUGIN_IDS: ReadonlySet<string> = new Set(Object.values(HOST_SLOTS));\n\ninterface RegistryState {\n plugins: WebPluginDefinition[];\n tabs: TabContribution[];\n dockFaces: DockFaceContribution[];\n channels: Map<string, SessionChannelContribution>;\n commands: PaletteCommandContribution[];\n contextActions: InstalledContextAction[];\n userMessageActions: InstalledUserMessageAction[];\n leaderBindings: LeaderBindingContribution[];\n selectionAxes: SelectionAxisContribution[];\n minorModes: MinorModeContribution[];\n activityGroups: ActivityGroupContribution[];\n settingsSections: SettingsSectionContribution[];\n settingsPanels: InstalledSettingsPanel[];\n toolRenderers: Map<string, ToolRendererContribution>;\n toolMatchers: ToolRendererContribution[];\n slots: Map<string, SlotDeclaration>;\n fills: Map<string, ResolvedFill[]>;\n fileLinks: FileLinkSource[];\n diagnostics: InstallDiagnostic[];\n}\n\nfunction emptyState(): RegistryState {\n return {\n plugins: [],\n tabs: [],\n dockFaces: [],\n channels: new Map(),\n commands: [],\n contextActions: [],\n userMessageActions: [],\n leaderBindings: [],\n selectionAxes: [],\n minorModes: [],\n activityGroups: [],\n settingsSections: [],\n settingsPanels: [],\n toolRenderers: new Map(),\n toolMatchers: [],\n slots: new Map(),\n fills: new Map(),\n fileLinks: [],\n diagnostics: [],\n };\n}\n\nexport interface InstalledRepositorySettingsPanel extends RepositorySettingsPanelContribution {\n pluginId: string;\n}\nexport interface InstalledSettingsPanel extends SettingsPanelContribution {\n pluginId: string;\n}\nexport interface InstalledGlobalPluginProvider {\n pluginId: string;\n provider: ComponentType<{ children?: ReactNode }>;\n}\n\nexport interface InstalledHomeContribution {\n pluginId: string;\n id: string;\n order: number;\n data: HomeContribution;\n mount: Exclude<WebPluginMount, { scope: 'session' }>;\n}\n\n/** An independently owned host plugin registry. */\nexport function createWebPluginRegistry(hostId?: string) {\n let defaultState = emptyState();\n let installingState = defaultState;\n let defaultInstalled = false;\n let providers: readonly InstalledGlobalPluginProvider[] = [];\n let themes: readonly InstalledPluginTheme[] = [];\n const sessionStates = new Map<string, RegistryState>();\n const workspaceStates = new Map<string, RegistryState>();\n const sessionPlugins = new Map<string, readonly WebPluginDefinition[]>();\n const sessionWorkspaces = new Map<string, string>();\n let activeWorkspaceId: string | null = null;\n const pendingSessionFrames = new Map<string, Map<string, Record<string, unknown>>>();\n const MAX_PENDING_CHANNEL_TYPES = 64;\n let activeSessionId: string | null = null;\n /** Slots each mount could not load, keyed `global`, `workspace:<id>` or `session:<id>`. */\n const loadDiagnostics = new Map<string, readonly InstallDiagnostic[]>();\n let registryRevision = 0;\n const registryListeners = new Set<() => void>();\n\n function activeState(sessionId?: string | null): RegistryState {\n if (sessionId !== undefined && sessionId !== null) {\n const workspaceId = sessionWorkspaces.get(sessionId);\n return (\n sessionStates.get(sessionId) ??\n (workspaceId === undefined ? undefined : workspaceStates.get(workspaceId)) ??\n defaultState\n );\n }\n return (\n (activeSessionId === null ? undefined : sessionStates.get(activeSessionId)) ?? workspaceState() ?? defaultState\n );\n }\n\n function workspaceState(): RegistryState | undefined {\n return activeWorkspaceId === null ? undefined : workspaceStates.get(activeWorkspaceId);\n }\n\n /** Settings requests an explicit scope; the cockpit reads its active session composition. */\n function webTemplateCatalog(mount?: WebPluginMount): WebTemplateCatalog {\n if (mount === undefined) {\n const scope = activeSessionId === null ? (activeWorkspaceId === null ? 'host' : 'workspace') : 'session';\n return collectWebTemplates(activeState().plugins, scope);\n }\n if (mount.scope === 'host') return collectWebTemplates(defaultState.plugins, 'host');\n const workspace = workspaceStates.get(mount.workspaceId);\n const plugins = mount.scope === 'session' ? sessionStates.get(mount.sessionId)?.plugins : undefined;\n return collectWebTemplates(\n plugins ?? mergeScopedPlugins(defaultState.plugins, workspace?.plugins ?? []),\n mount.scope,\n );\n }\n\n /** The phone app's layouts at the server-resolved `native.template` mount. */\n function nativeTemplateCatalog(mount: WebPluginMount): NativeTemplateCatalog {\n if (mount.scope === 'host') return collectNativeTemplates(defaultState.plugins, 'host');\n const workspace = workspaceStates.get(mount.workspaceId);\n const plugins = mount.scope === 'session' ? sessionStates.get(mount.sessionId)?.plugins : undefined;\n return collectNativeTemplates(\n plugins ?? mergeScopedPlugins(defaultState.plugins, workspace?.plugins ?? []),\n mount.scope,\n );\n }\n function rebuildSession(sessionId: string): RegistryState {\n const previous = sessionStates.get(sessionId);\n const workspaceId = sessionWorkspaces.get(sessionId);\n const workspace = workspaceId === undefined ? undefined : workspaceStates.get(workspaceId);\n const state = buildLiveState(\n mergeScopedPlugins(defaultState.plugins, workspace?.plugins ?? [], sessionPlugins.get(sessionId) ?? []),\n );\n sessionStates.set(sessionId, state);\n // Drop stale stores before replay, since replacement channels may share a store.\n for (const [type, channel] of previous?.channels.entries() ?? [])\n if (state.channels.get(type) !== channel) channel.drop(sessionId);\n const pending = pendingSessionFrames.get(sessionId);\n if (pending !== undefined) {\n for (const [type, frame] of pending) if (dispatchFrameToState(state, frame)) pending.delete(type);\n if (pending.size === 0) pendingSessionFrames.delete(sessionId);\n }\n return state;\n }\n\n /** Themes are the person's, so only the global plugins contribute them. */\n function installThemes(plugins: readonly WebPluginDefinition[]): void {\n const collected = collectPluginThemes(plugins);\n themes = collected.themes;\n defaultState.diagnostics.push(...collected.diagnostics);\n }\n\n function installGlobalWebPlugins(plugins: readonly WebPluginDefinition[]): void {\n defaultState = buildLiveState(pluginsAtScope(plugins, 'host'), plugins);\n providers = defaultState.plugins.flatMap((plugin) => {\n const provider = plugins.find((definition) => definition.id === plugin.id)?.host?.provider;\n return provider === undefined\n ? []\n : [{ pluginId: hostId === undefined ? plugin.id : qualifyHostId(hostId, plugin.id), provider }];\n });\n installThemes(plugins);\n for (const id of sessionStates.keys()) rebuildSession(id);\n emitRegistryChange();\n }\n\n function installWorkspaceWebPlugins(workspaceId: string, plugins: readonly WebPluginDefinition[]): void {\n const state = buildLiveState(pluginsAtScope(plugins, 'workspace'), plugins);\n workspaceStates.set(workspaceId, state);\n for (const [id, owner] of sessionWorkspaces) if (owner === workspaceId) rebuildSession(id);\n emitRegistryChange();\n }\n\n function removeWorkspaceWebPlugins(workspaceId: string): void {\n workspaceStates.delete(workspaceId);\n loadDiagnostics.delete(`workspace:${workspaceId}`);\n for (const [id, owner] of sessionWorkspaces) if (owner === workspaceId) rebuildSession(id);\n if (activeWorkspaceId === workspaceId) activeWorkspaceId = null;\n emitRegistryChange();\n }\n\n function activateWebPluginWorkspace(workspaceId: string | null): void {\n if (activeWorkspaceId === workspaceId) return;\n activeWorkspaceId = workspaceId;\n emitRegistryChange();\n }\n\n function bindSessionWebWorkspace(sessionId: string, workspaceId: string): void {\n sessionWorkspaces.set(sessionId, workspaceId);\n rebuildSession(sessionId);\n }\n\n function emitRegistryChange(): void {\n registryRevision += 1;\n for (const listener of registryListeners) listener();\n }\n\n /** The TUI's leader alphabet: one lowercase letter or digit per segment. */\n const LEADER_KEY = /^[a-z0-9]$/;\n const MAX_LEADER_PATH = 4;\n\n /**\n * A malformed binding fails the install rather than the keypress: the plugin\n * set is generated at build time, so this is a developer error, and the TUI's\n * registry refuses the same shapes.\n */\n function checkLeaderBinding(pluginId: string, binding: LeaderBindingContribution): void {\n if (binding.path.length === 0 || binding.path.length > MAX_LEADER_PATH) {\n throw new Error(\n `Web plugin '${pluginId}' leader binding '${binding.id}' needs 1 to ${MAX_LEADER_PATH} path segments.`,\n );\n }\n for (const segment of binding.path) {\n if (!LEADER_KEY.test(segment.key)) {\n throw new Error(\n `Web plugin '${pluginId}' leader binding '${binding.id}' key '${segment.key}' must be one lowercase letter or digit.`,\n );\n }\n if (segment.label.trim() === '') {\n throw new Error(`Web plugin '${pluginId}' leader binding '${binding.id}' has an unlabeled segment.`);\n }\n }\n }\n\n interface PendingFill {\n pluginId: string;\n fill: SlotFillContribution;\n }\n\n interface PendingSection {\n pluginId: string;\n section: SurfaceContribution;\n }\n\n interface PendingBinding {\n pluginId: string;\n binding: LeaderBindingContribution;\n }\n\n type SharedNamespace =\n | 'plugin'\n | 'tab'\n | 'dock-face'\n | 'channel'\n | 'tool'\n | 'activity-group'\n | 'minor-mode'\n | 'selection-axis'\n | 'palette-command'\n | 'settings-section';\n\n /**\n * Claims `id` in one shared namespace: false, with a diagnostic, when another\n * plugin already holds it; a throw when this plugin declared it twice, which\n * is a developer error rather than a composition.\n */\n function claim(owners: Map<string, string>, thing: SharedNamespace, id: string, pluginId: string): boolean {\n const holder = owners.get(id);\n if (holder === pluginId) {\n throw new Error(`Web plugin '${pluginId}' declares ${thing.replace('-', ' ')} '${id}' twice.`);\n }\n if (holder !== undefined) {\n installingState.diagnostics.push({\n pluginId,\n kind: `duplicate-${thing}`,\n message: `Web plugin '${pluginId}' ${thing.replace('-', ' ')} '${id}' is already provided by '${holder}'; keeping the first.`,\n });\n return false;\n }\n owners.set(id, pluginId);\n return true;\n }\n\n function surfaceFill(slot: string, surface: SurfaceContribution): SlotFillContribution {\n return { slot, id: surface.id, component: surface.component };\n }\n\n function checkSlotDeclaration(pluginId: string, declared: Set<string>, declaration: SlotDeclaration): void {\n const prefix = `${pluginId}${SLOT_SEPARATOR}`;\n if (!declaration.slot.startsWith(prefix) || declaration.slot.length === prefix.length) {\n throw new Error(\n `Web plugin '${pluginId}' declares slot '${declaration.slot}', which must be named '${prefix}<name>'.`,\n );\n }\n if (declared.has(declaration.slot)) {\n throw new Error(`Web plugin '${pluginId}' declares slot '${declaration.slot}' twice.`);\n }\n declared.add(declaration.slot);\n }\n\n function checkFill(pluginId: string, seen: Set<string>, fill: SlotFillContribution): void {\n if (fill.id === '') throw new Error(`Web plugin '${pluginId}' has a fill into '${fill.slot}' with an empty id.`);\n if (fill.component === undefined && fill.data === undefined) {\n throw new Error(\n `Web plugin '${pluginId}' fill '${fill.id}' into '${fill.slot}' has neither a component nor data.`,\n );\n }\n const key = `${fill.slot} ${fill.id}`;\n if (seen.has(key)) throw new Error(`Web plugin '${pluginId}' fills '${fill.slot}' with id '${fill.id}' twice.`);\n seen.add(key);\n }\n\n function checkContextAction(pluginId: string, seen: Set<string>, action: ContextActionContribution): void {\n if (action.id.trim() === '') throw new Error(`Web plugin '${pluginId}' has a context action with an empty id.`);\n if (seen.has(action.id)) throw new Error(`Web plugin '${pluginId}' declares context action '${action.id}' twice.`);\n if (action.label.trim() === '')\n throw new Error(`Web plugin '${pluginId}' context action '${action.id}' has an empty label.`);\n if (action.kinds.length === 0 || action.kinds.some((kind) => kind.trim() === '')) {\n throw new Error(`Web plugin '${pluginId}' context action '${action.id}' needs non-empty kinds.`);\n }\n seen.add(action.id);\n }\n\n function checkUserMessageAction(pluginId: string, seen: Set<string>, action: UserMessageActionContribution): void {\n if (action.id.trim() === '')\n throw new Error(`Web plugin '${pluginId}' has a user message action with an empty id.`);\n if (seen.has(action.id))\n throw new Error(`Web plugin '${pluginId}' declares user message action '${action.id}' twice.`);\n if (action.label.trim() === '')\n throw new Error(`Web plugin '${pluginId}' user message action '${action.id}' has an empty label.`);\n seen.add(action.id);\n }\n\n const byFillOrder = (left: ResolvedFill, right: ResolvedFill): number =>\n left.order - right.order || left.pluginId.localeCompare(right.pluginId) || left.id.localeCompare(right.id);\n\n const byDisplayOrder = (left: { order?: number; name: string }, right: { order?: number; name: string }): number =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) || left.name.localeCompare(right.name);\n\n function placeFill(pluginId: string, fill: SlotFillContribution): void {\n const declaration = installingState.slots.get(fill.slot);\n if (declaration === undefined) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'orphan-fill',\n message: `Web plugin '${pluginId}' fills slot '${fill.slot}', which no installed plugin declares; nothing is placed.`,\n });\n return;\n }\n let data = fill.data;\n if (data !== undefined && declaration.parse !== undefined) {\n const parsed = declaration.parse(data);\n if (parsed === null) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'rejected-fill',\n message: `Web plugin '${pluginId}' fill '${fill.id}' into '${fill.slot}' was rejected by the slot's parse gate.`,\n });\n return;\n }\n data = parsed;\n }\n const placed: ResolvedFill = {\n slot: fill.slot,\n pluginId,\n id: fill.id,\n order: fill.order ?? DEFAULT_FILL_ORDER,\n ...(data === undefined ? {} : { data }),\n ...(fill.component === undefined ? {} : { component: fill.component }),\n };\n const list = installingState.fills.get(fill.slot);\n if (list === undefined) installingState.fills.set(fill.slot, [placed]);\n else list.push(placed);\n }\n\n function resolveLeaderConflicts(bindings: readonly PendingBinding[]): void {\n const owner = new Map<LeaderBindingContribution, string>(bindings.map((entry) => [entry.binding, entry.pluginId]));\n for (const conflict of leaderConflicts(bindings.map((entry) => entry.binding))) {\n const winner = owner.get(conflict.winner) ?? '';\n const loser = owner.get(conflict.loser) ?? '';\n if (winner === loser) {\n throw new Error(\n `Web plugin '${winner}' binds Leader Space '${conflict.path}' twice ('${conflict.loser.id}' and '${conflict.winner.id}').`,\n );\n }\n if (conflict.kind === 'leaf-override') {\n installingState.diagnostics.push({\n pluginId: loser,\n kind: 'leader-leaf-override',\n message: `Web plugin '${loser}' Leader Space leaf '${conflict.path}' ('${conflict.loser.id}') is taken over by '${winner}' ('${conflict.winner.id}').`,\n });\n } else {\n installingState.diagnostics.push({\n pluginId: loser,\n kind: 'leader-group-label',\n message: `Web plugin '${loser}' words Leader Space group '${conflict.path}' differently from '${winner}', which named it first; keeping the first label.`,\n });\n }\n }\n }\n\n function buildWebPluginState(\n plugins: readonly WebPluginDefinition[],\n definitions: readonly WebPluginDefinition[] = plugins,\n ): RegistryState {\n const previous = installingState;\n installingState = emptyState();\n try {\n const owners: Record<SharedNamespace, Map<string, string>> = {\n plugin: new Map(),\n tab: new Map(),\n 'dock-face': new Map(),\n channel: new Map(),\n tool: new Map(),\n 'activity-group': new Map(),\n 'minor-mode': new Map(),\n 'selection-axis': new Map(),\n 'palette-command': new Map(),\n 'settings-section': new Map(),\n };\n const pendingFills: PendingFill[] = [];\n const pendingSections: PendingSection[] = [];\n const pendingBindings: PendingBinding[] = [];\n const pendingSlots: SlotDeclaration[] = [];\n\n // Phase 1: collect, in the generated (registrationOrder, pluginId) order.\n for (const plugin of plugins) {\n if (RESERVED_PLUGIN_IDS.has(plugin.id)) {\n throw new Error(`Web plugin id '${plugin.id}' is reserved for a host slot.`);\n }\n if (owners.plugin.has(plugin.id)) {\n installingState.diagnostics.push({\n pluginId: plugin.id,\n kind: 'duplicate-plugin',\n message: `Web plugin id '${plugin.id}' is declared twice; keeping the first definition.`,\n });\n continue;\n }\n owners.plugin.set(plugin.id, plugin.id);\n installingState.plugins.push(plugin);\n for (const tab of plugin.tabs ?? []) {\n if (claim(owners.tab, 'tab', tab.id, plugin.id)) installingState.tabs.push(tab);\n }\n for (const face of plugin.dockFaces ?? []) {\n if (face.id === 'activity' || face.id === 'context') {\n throw new Error(`Web plugin '${plugin.id}' dock face '${face.id}' is reserved by the host.`);\n }\n if (face.id.trim() === '' || face.label.trim() === '') {\n throw new Error(`Web plugin '${plugin.id}' has an unlabeled dock face.`);\n }\n if (claim(owners['dock-face'], 'dock-face', face.id, plugin.id)) installingState.dockFaces.push(face);\n }\n // A panel and a section both become a /settings/:id route, so the two\n // share one id namespace rather than racing to own the same URL.\n for (const section of plugin.settingsSections ?? []) {\n if (claim(owners['settings-section'], 'settings-section', section.id, plugin.id)) {\n installingState.settingsSections.push(section);\n }\n }\n for (const panel of plugin.settingsPanels ?? []) {\n if (claim(owners['settings-section'], 'settings-section', panel.id, plugin.id)) {\n installingState.settingsPanels.push({ pluginId: plugin.id, ...panel });\n }\n }\n for (const channel of plugin.channels ?? []) {\n if (claim(owners.channel, 'channel', channel.channel, plugin.id))\n installingState.channels.set(channel.channel, channel);\n }\n for (const command of plugin.paletteCommands ?? []) {\n if (claim(owners['palette-command'], 'palette-command', command.id, plugin.id))\n installingState.commands.push(command);\n }\n const contextActions = new Set<string>();\n for (const action of plugin.contextActions ?? []) {\n checkContextAction(plugin.id, contextActions, action);\n installingState.contextActions.push({ pluginId: plugin.id, ...action });\n }\n const userMessageActions = new Set<string>();\n for (const action of plugin.userMessageActions ?? []) {\n checkUserMessageAction(plugin.id, userMessageActions, action);\n installingState.userMessageActions.push({ pluginId: plugin.id, ...action });\n }\n for (const binding of plugin.leaderBindings ?? []) {\n checkLeaderBinding(plugin.id, binding);\n pendingBindings.push({ pluginId: plugin.id, binding });\n }\n for (const axis of plugin.selectionAxes ?? []) {\n if (claim(owners['selection-axis'], 'selection-axis', axis.name, plugin.id))\n installingState.selectionAxes.push(axis);\n }\n for (const mode of plugin.minorModes ?? []) {\n if (claim(owners['minor-mode'], 'minor-mode', mode.name, plugin.id)) installingState.minorModes.push(mode);\n }\n for (const group of plugin.activityGroups ?? []) {\n if (claim(owners['activity-group'], 'activity-group', group.name, plugin.id))\n installingState.activityGroups.push(group);\n }\n for (const renderer of plugin.toolRenderers ?? []) {\n for (const tool of renderer.tools) {\n if (claim(owners.tool, 'tool', tool, plugin.id)) installingState.toolRenderers.set(tool, renderer);\n }\n if (renderer.matches !== undefined) installingState.toolMatchers.push(renderer);\n }\n const declared = new Set<string>();\n for (const declaration of plugin.slots ?? []) {\n checkSlotDeclaration(plugin.id, declared, declaration);\n pendingSlots.push(declaration);\n }\n const filled = new Set<string>();\n for (const fill of plugin.fills ?? []) {\n checkFill(plugin.id, filled, fill);\n pendingFills.push({ pluginId: plugin.id, fill });\n }\n for (const surface of plugin.overlays ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.overlay, surface) });\n }\n for (const surface of plugin.railSections ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.rail, surface) });\n }\n for (const surface of plugin.contextSections ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.context, surface) });\n }\n for (const surface of plugin.selectionBarItems ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.selectionBar, surface) });\n }\n for (const surface of plugin.composerActions ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.composerActions, surface) });\n }\n for (const surface of plugin.composerMenuItems ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.composerMenu, surface) });\n }\n for (const section of plugin.activitySections ?? []) pendingSections.push({ pluginId: plugin.id, section });\n if (plugin.fileLinks !== undefined) installingState.fileLinks.push(plugin.fileLinks);\n }\n\n installingState.diagnostics.push(...collectWebTemplates(installingState.plugins).diagnostics);\n\n // Phase 2: resolve by name, now that every declaration is known.\n for (const slot of Object.values(HOST_SLOTS)) installingState.slots.set(slot, { slot });\n installingState.slots.set(HOST_SLOTS.home, { slot: HOST_SLOTS.home, parse: parseHomeContribution });\n for (const group of installingState.activityGroups) {\n installingState.slots.set(activityGroupSlot(group.name), { slot: activityGroupSlot(group.name) });\n }\n for (const declaration of pendingSlots) installingState.slots.set(declaration.slot, declaration);\n for (const { pluginId, section } of pendingSections) {\n const keyed = activityGroupSlot(section.id);\n pendingFills.push({\n pluginId,\n fill: surfaceFill(installingState.slots.has(keyed) ? keyed : HOST_SLOTS.activity, section),\n });\n }\n for (const { pluginId, fill } of pendingFills) {\n if (\n fill.slot === HOST_SLOTS.dashboardTiles &&\n (parseDashboardTileData(fill.data) === null || fill.component === undefined)\n ) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'rejected-fill',\n message: `Web plugin '${pluginId}' dashboard tile '${fill.id}' needs valid presentation data and a body component.`,\n });\n continue;\n }\n if (fill.slot === HOST_SLOTS.home) {\n const data = parseHomeContribution(fill.data);\n const definition = definitions.find((plugin) => plugin.id === pluginId);\n const sources = [definition, definition?.host, definition?.workspace, definition?.session].flatMap(\n (contribution) => contribution?.channels ?? [],\n );\n if (data === null || !sources.some((channel) => channel.channel === data.source)) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'rejected-fill',\n message: `Web plugin '${pluginId}' Home fill '${fill.id}' needs valid data and an owned source channel.`,\n });\n continue;\n }\n }\n placeFill(pluginId, fill);\n }\n for (const list of installingState.fills.values()) list.sort(byFillOrder);\n\n resolveLeaderConflicts(pendingBindings);\n installingState.leaderBindings.push(...pendingBindings.map((entry) => entry.binding));\n installingState.contextActions.sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) ||\n left.pluginId.localeCompare(right.pluginId) ||\n left.id.localeCompare(right.id),\n );\n installingState.userMessageActions.sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) ||\n left.pluginId.localeCompare(right.pluginId) ||\n left.id.localeCompare(right.id),\n );\n installingState.selectionAxes.sort(byDisplayOrder);\n installingState.minorModes.sort(byDisplayOrder);\n installingState.activityGroups.sort(byDisplayOrder);\n installingState.dockFaces.sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) || left.id.localeCompare(right.id),\n );\n return installingState;\n } finally {\n installingState = previous;\n }\n }\n\n /**\n * Live mounts load developer plugins at runtime, so a plugin whose own build\n * throws is skipped with a diagnostic instead of blanking every other plugin.\n */\n function buildLiveState(\n plugins: readonly WebPluginDefinition[],\n definitions: readonly WebPluginDefinition[] = plugins,\n ): RegistryState {\n const rejected: InstallDiagnostic[] = [];\n const admitted = plugins.filter((plugin) => {\n try {\n buildWebPluginState([plugin], definitions);\n return true;\n } catch (error) {\n rejected.push({\n pluginId: plugin.id,\n kind: 'invalid-plugin',\n message: `Web plugin '${plugin.id}' was skipped: ${error instanceof Error ? error.message : String(error)}`,\n });\n return false;\n }\n });\n const state = buildWebPluginState(admitted, definitions);\n state.diagnostics.unshift(...rejected);\n return state;\n }\n\n function installWebPlugins(plugins: readonly WebPluginDefinition[]): void {\n if (defaultInstalled) throw new Error('Web plugins are already installed.');\n defaultState = buildWebPluginState(plugins);\n providers = defaultState.plugins.flatMap((plugin) => {\n const provider = plugin.host?.provider;\n return provider === undefined\n ? []\n : [{ pluginId: hostId === undefined ? plugin.id : qualifyHostId(hostId, plugin.id), provider }];\n });\n installThemes(plugins);\n installingState = defaultState;\n defaultInstalled = true;\n }\n\n function webPluginsInstalled(): boolean {\n return defaultInstalled;\n }\n\n /** Unit-test escape hatch; production installs exactly once. */\n function resetWebPlugins(): void {\n defaultState = emptyState();\n installingState = defaultState;\n defaultInstalled = false;\n providers = [];\n themes = [];\n sessionStates.clear();\n mcpAppRenderers.clear();\n workspaceStates.clear();\n sessionPlugins.clear();\n sessionWorkspaces.clear();\n activeWorkspaceId = null;\n pendingSessionFrames.clear();\n loadDiagnostics.clear();\n activeSessionId = null;\n emitRegistryChange();\n }\n\n /** Installs or atomically replaces one session's independently synchronized plugin definitions. */\n function installSessionWebPlugins(sessionId: string, plugins: readonly WebPluginDefinition[]): void {\n sessionPlugins.set(\n sessionId,\n plugins.flatMap((plugin) => (plugin.session === undefined ? [plugin] : pluginsAtScope([plugin], 'session'))),\n );\n rebuildSession(sessionId);\n // Background-session consumers also wait for their verified composition to arrive.\n emitRegistryChange();\n }\n\n /** Selects which session composition the no-argument contribution readers expose. */\n function activateWebPluginSession(sessionId: string | null): void {\n if (activeSessionId === sessionId) return;\n activeSessionId = sessionId;\n emitRegistryChange();\n }\n\n /** Removes one session registry after its plugin-owned stores have been dropped. */\n function removeSessionWebPlugins(sessionId: string): void {\n const sessionState = sessionStates.get(sessionId);\n pendingSessionFrames.delete(sessionId);\n loadDiagnostics.delete(`session:${sessionId}`);\n if (sessionState === undefined) return;\n for (const channel of sessionState.channels.values()) channel.drop(sessionId);\n sessionStates.delete(sessionId);\n sessionPlugins.delete(sessionId);\n sessionWorkspaces.delete(sessionId);\n if (sessionId === activeSessionId) emitRegistryChange();\n }\n\n function subscribeWebPluginRegistry(listener: () => void): () => void {\n registryListeners.add(listener);\n return () => registryListeners.delete(listener);\n }\n\n function webPluginRegistryRevision(): number {\n return registryRevision;\n }\n\n /**\n * Records the slots one mount could not load, replacing its previous record. The mount still\n * installs the slots that loaded, so one broken plugin never hides the others.\n */\n function setWebPluginLoadDiagnostics(mount: WebPluginMount, diagnostics: readonly InstallDiagnostic[]): void {\n const key =\n mount.scope === 'host'\n ? 'host'\n : mount.scope === 'workspace'\n ? `workspace:${mount.workspaceId}`\n : `session:${mount.sessionId}`;\n if (diagnostics.length === 0 && !loadDiagnostics.has(key)) return;\n if (diagnostics.length === 0) loadDiagnostics.delete(key);\n else loadDiagnostics.set(key, [...diagnostics]);\n emitRegistryChange();\n }\n\n /**\n * What the install had to resolve between plugins, plus the slots the visible mounts could not\n * load; empty for a composition whose plugins all load and never collide.\n */\n function webPluginDiagnostics(): readonly InstallDiagnostic[] {\n const workspaceId =\n (activeSessionId === null ? undefined : sessionWorkspaces.get(activeSessionId)) ?? activeWorkspaceId;\n const failed = [\n 'host',\n ...(workspaceId === null ? [] : [`workspace:${workspaceId}`]),\n ...(activeSessionId === null ? [] : [`session:${activeSessionId}`]),\n ].flatMap((key) => loadDiagnostics.get(key) ?? []);\n const installed = activeState().diagnostics;\n return failed.length === 0 ? installed : [...installed, ...failed];\n }\n\n /** Every installed plugin definition, in install order; the settings page lists them. */\n function installedWebPlugins(): readonly WebPluginDefinition[] {\n return activeState().plugins;\n }\n\n /** Package panels placed under the host's repository controls, in stable display order. */\n function pluginRepositorySettingsPanels(): readonly InstalledRepositorySettingsPanel[] {\n return (workspaceState() ?? emptyState()).plugins\n .flatMap((plugin) =>\n plugin.repositorySettingsPanel === undefined\n ? []\n : [{ pluginId: plugin.id, ...plugin.repositorySettingsPanel }],\n )\n .sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) ||\n left.pluginId.localeCompare(right.pluginId),\n );\n }\n\n function webTabs(sessionId?: string | null): readonly TabContribution[] {\n return activeState(sessionId).tabs;\n }\n\n /** Optional right-dock faces from the active session composition, in display order. */\n function pluginDockFaces(): readonly DockFaceContribution[] {\n return activeState().dockFaces;\n }\n\n /** UI discovery only. Requests still require a proof injected by Electron's main process. */\n function isDesktopClient(): boolean {\n return (\n typeof window !== 'undefined' &&\n (window as Window & { poDesktop?: { platform?: string } }).poDesktop?.platform === 'desktop'\n );\n }\n /**\n * The settings pages plugins contribute, in menu order. Sorted here rather than\n * at the reader so the menu and the page agree without either sorting twice.\n */\n function pluginSettingsSections(scope: 'host' | 'workspace' = 'host'): readonly SettingsSectionContribution[] {\n const sections = (scope === 'host' ? defaultState : workspaceState())?.settingsSections ?? [];\n const visible = isDesktopClient() ? sections : sections.filter((section) => !section.desktopOnly);\n if (!isSelfHostShell()) return visible;\n return visible.map((section) => {\n const fields = section.fields.filter((field) => !field.localOnly);\n return {\n ...section,\n fields,\n ...(section.groups === undefined\n ? {}\n : { groups: section.groups.filter((group) => fields.some((field) => field.group === group.id)) }),\n };\n });\n }\n\n /** The settings pages plugins draw themselves, in install order; the reader sorts them with the sections. */\n function pluginSettingsPanels(): readonly InstalledSettingsPanel[] {\n return defaultState.settingsPanels;\n }\n\n /** The fills placed into one slot, in slot order; empty for a slot nobody declared. */\n function slotFills(slot: string, sessionId?: string | null): readonly ResolvedFill[] {\n return activeState(sessionId).fills.get(slot) ?? [];\n }\n\n /** One workspace's own fills for a slot, whichever session or workspace is focused. */\n function workspaceSlotFills(workspaceId: string, slot: string): readonly ResolvedFill[] {\n return workspaceStates.get(workspaceId)?.fills.get(slot) ?? [];\n }\n\n /** The global plugins' fills for a slot, whichever session or workspace is focused. */\n function globalSlotFills(slot: string): readonly ResolvedFill[] {\n return defaultState.fills.get(slot) ?? [];\n }\n\n /** Dashboard reads never inherit the currently focused session. */\n function dashboardTileFills(mount: Exclude<WebPluginMount, { scope: 'session' }>): readonly InstalledDashboardTile[] {\n const surface = mount.scope === 'workspace' ? 'workspace' : 'home';\n const global = (defaultState.fills.get(HOST_SLOTS.dashboardTiles) ?? []).filter((fill) =>\n ((fill.data as DashboardTileData).surfaces ?? ['home']).includes(surface),\n );\n const workspace =\n mount.scope === 'workspace'\n ? (workspaceStates.get(mount.workspaceId)?.fills.get(HOST_SLOTS.dashboardTiles) ?? [])\n : [];\n const merged = new Map<string, ResolvedFill>();\n for (const fill of [...global, ...workspace]) merged.set(JSON.stringify([fill.pluginId, fill.id]), fill);\n return [...merged.values()].sort(byFillOrder) as InstalledDashboardTile[];\n }\n\n /** A dual-publishing plugin uses its new Home tiles, never both card versions. */\n function legacyHomeAppFills(): readonly ResolvedFill[] {\n const tiled = new Set(dashboardTileFills({ scope: 'host' }).map((fill) => fill.pluginId));\n return globalSlotFills(HOST_SLOTS.homeApps).filter((fill) => !tiled.has(fill.pluginId));\n }\n\n /** Home reads an explicit host mount, never the focused session or workspace. */\n function pluginHomeContributions(\n mount: Exclude<WebPluginMount, { scope: 'session' }>,\n ): readonly InstalledHomeContribution[] {\n const global = defaultState.fills.get(HOST_SLOTS.home) ?? [];\n const workspace =\n mount.scope === 'workspace' ? (workspaceStates.get(mount.workspaceId)?.fills.get(HOST_SLOTS.home) ?? []) : [];\n const seen = new Set<string>();\n const contributions: InstalledHomeContribution[] = [];\n for (const fill of [...global, ...workspace]) {\n const data = parseHomeContribution(fill.data);\n if (data === null) continue;\n const key = `${fill.pluginId}\\0${data.source}`;\n if (seen.has(key)) continue;\n seen.add(key);\n contributions.push({\n pluginId: fill.pluginId,\n id: fill.id,\n order: fill.order,\n data,\n mount: global.includes(fill) ? { scope: 'host' } : mount,\n });\n }\n return contributions.sort(\n (left, right) =>\n left.order - right.order || left.pluginId.localeCompare(right.pluginId) || left.id.localeCompare(right.id),\n );\n }\n\n function paletteCommands(): readonly PaletteCommandContribution[] {\n return activeState().commands;\n }\n\n /** Context actions from every installed plugin, in stable display order. */\n function pluginContextActions(sessionId?: string | null): readonly InstalledContextAction[] {\n return activeState(sessionId).contextActions;\n }\n\n /** User-message actions from every installed plugin, in stable display order. */\n function pluginUserMessageActions(): readonly InstalledUserMessageAction[] {\n return activeState().userMessageActions;\n }\n\n /** Leader Space bindings from every installed plugin, in install order: a later binding on a bound leaf wins. */\n function pluginLeaderBindings(): readonly LeaderBindingContribution[] {\n return activeState().leaderBindings;\n }\n\n /** Selection-axis declarations from every installed plugin, in display order. */\n function pluginSelectionAxes(): readonly SelectionAxisContribution[] {\n return activeState().selectionAxes;\n }\n\n /** Minor-mode declarations from every installed plugin, in display order. */\n function pluginMinorModes(): readonly MinorModeContribution[] {\n return activeState().minorModes;\n }\n\n /** Activity-dock group declarations from every installed plugin, in display order. */\n function pluginActivityGroups(sessionId?: string | null): readonly ActivityGroupContribution[] {\n const groups = activeState(sessionId).activityGroups;\n return isDesktopClient() ? groups : groups.filter((group) => !group.desktopOnly);\n }\n\n /**\n * The file-link sources installed plugins contribute, in install order.\n *\n * More than one is allowed and the first to claim a path wins, the same way a\n * runtime tool matcher does: the host has no way to choose between two\n * packages that both recognise a path, and the alternative is two tabs for one\n * file.\n */\n function pluginFileLinks(sessionId?: string | null): readonly FileLinkSource[] {\n return activeState(sessionId).fileLinks;\n }\n\n /**\n * The renderer a plugin registered for one tool: the exact name claim first,\n * then the first runtime matcher that accepts it, in install order (the one\n * place besides `start` where that order is observable); undefined leaves\n * the host's default card.\n */\n function pluginToolRenderer(\n toolName: string,\n statuses: Readonly<Record<string, string>> = {},\n details?: unknown,\n ): ToolRendererContribution | undefined {\n return resolveToolRenderer(activeState(), toolName, statuses, details);\n }\n\n function resolveToolRenderer(\n state: RegistryState,\n toolName: string,\n statuses: Readonly<Record<string, string>>,\n details: unknown,\n ): ToolRendererContribution | undefined {\n return (\n state.toolRenderers.get(toolName) ??\n state.toolMatchers.find((renderer) => {\n try {\n return renderer.matches?.(toolName, statuses, details);\n } catch {\n // A plugin's predicate must not take down tool cards, prompts or completion routing.\n return false;\n }\n })\n );\n }\n\n /**\n * A session-scoped renderer, resolved the way pluginToolRenderer resolves the\n * active one, or undefined until that session's verified composition is installed.\n */\n function sessionToolRenderer(\n sessionId: string,\n toolName: string,\n statuses: Readonly<Record<string, string>> = {},\n details?: unknown,\n ): ToolRendererContribution | undefined {\n const state = sessionStates.get(sessionId);\n return state === undefined ? undefined : resolveToolRenderer(state, toolName, statuses, details);\n }\n\n function sessionWebPluginsInstalled(sessionId: string): boolean {\n return sessionPlugins.has(sessionId);\n }\n\n /**\n * Routes one wire frame to the channel owning its type. Returns false when no\n * channel claims it, so the demux can fall through silently the way unknown\n * frames always have.\n */\n function dispatchFrameToState(state: RegistryState, frame: Record<string, unknown>): boolean {\n if (typeof frame.type !== 'string' || typeof frame.sessionId !== 'string') return false;\n const channel = state.channels.get(frame.type);\n if (channel === undefined) return false;\n const payload = channel.parse(frame.payload);\n if (payload !== null) channel.apply(frame.sessionId, payload);\n return true;\n }\n\n function dispatchChannelFrame(frame: Record<string, unknown>): boolean {\n if (typeof frame.type !== 'string' || typeof frame.sessionId !== 'string') return false;\n const state = sessionStates.get(frame.sessionId);\n if (state !== undefined) {\n if (dispatchFrameToState(state, frame)) return true;\n } else if (activeSessionId === null) return dispatchFrameToState(defaultState, frame);\n // Channel envelopes carry payload; protocol events do not and must not accumulate.\n if (!Object.hasOwn(frame, 'payload')) return false;\n const pending = pendingSessionFrames.get(frame.sessionId) ?? new Map<string, Record<string, unknown>>();\n if (!pending.has(frame.type) && pending.size >= MAX_PENDING_CHANNEL_TYPES) {\n const oldest = pending.keys().next().value as string | undefined;\n if (oldest !== undefined) pending.delete(oldest);\n }\n pending.set(frame.type, frame);\n pendingSessionFrames.set(frame.sessionId, pending);\n return false;\n }\n\n /** Session teardown: every channel forgets the session's data. */\n function dropPluginSessionData(sessionId: string): void {\n pendingSessionFrames.delete(sessionId);\n const state = sessionStates.get(sessionId) ?? (activeSessionId === null ? defaultState : undefined);\n for (const channel of state?.channels.values() ?? []) channel.drop(sessionId);\n }\n\n const mcpAppRenderers = new Map<string, NonNullable<WebPluginSlotProps['renderMcpApp']>>();\n\n function pluginMcpAppRenderer(sessionId: string | null) {\n return sessionId === null ? undefined : mcpAppRenderers.get(sessionId);\n }\n\n /**\n * Starts every plugin runtime in install order; the disposer runs in reverse. With `onFailure`\n * a plugin whose start throws is reported and skipped, so the others still start.\n */\n function startPluginDefinitions(\n plugins: readonly WebPluginDefinition[],\n runtime: WebPluginRuntime,\n onFailure?: (pluginId: string, error: unknown) => void,\n ): () => void {\n const disposers: Array<() => void> = [];\n const disposeStarted = (): void => {\n for (const dispose of disposers.reverse()) dispose();\n };\n for (const plugin of plugins) {\n try {\n const sessionId = runtime.mount?.scope === 'session' ? runtime.mount.sessionId : undefined;\n const dispose = plugin.start?.({\n ...runtime,\n ...(sessionId === undefined\n ? {}\n : {\n registerMcpAppRenderer(render) {\n mcpAppRenderers.set(sessionId, render);\n const unregister = () => {\n if (mcpAppRenderers.get(sessionId) === render) mcpAppRenderers.delete(sessionId);\n };\n disposers.push(unregister);\n return unregister;\n },\n }),\n });\n if (dispose) disposers.push(dispose);\n } catch (error) {\n if (onFailure) {\n onFailure(plugin.id, error);\n continue;\n }\n disposeStarted();\n throw error;\n }\n }\n return disposeStarted;\n }\n\n function startWebPlugins(runtime: WebPluginRuntime): () => void {\n return startPluginDefinitions(activeState().plugins, runtime);\n }\n\n const owner = <T extends { pluginId: string }>(entry: T): T =>\n hostId === undefined ? entry : { ...entry, pluginId: qualifyHostId(hostId, entry.pluginId) };\n return {\n globalPluginProviders: (): readonly InstalledGlobalPluginProvider[] => providers,\n pluginThemes: (): readonly InstalledPluginTheme[] => themes,\n webTemplateCatalog,\n nativeTemplateCatalog,\n installGlobalWebPlugins,\n installWorkspaceWebPlugins,\n removeWorkspaceWebPlugins,\n activateWebPluginWorkspace,\n bindSessionWebWorkspace,\n installWebPlugins,\n webPluginsInstalled,\n resetWebPlugins,\n installSessionWebPlugins,\n activateWebPluginSession,\n removeSessionWebPlugins,\n subscribeWebPluginRegistry,\n webPluginRegistryRevision,\n setWebPluginLoadDiagnostics,\n webPluginDiagnostics: (...args: Parameters<typeof webPluginDiagnostics>) =>\n webPluginDiagnostics(...args).map(owner),\n installedWebPlugins: () =>\n installedWebPlugins().map((plugin) =>\n hostId === undefined ? plugin : { ...plugin, id: qualifyHostId(hostId, plugin.id) },\n ),\n pluginRepositorySettingsPanels: (...args: Parameters<typeof pluginRepositorySettingsPanels>) =>\n pluginRepositorySettingsPanels(...args).map(owner),\n webTabs,\n pluginDockFaces,\n isDesktopClient,\n pluginSettingsSections,\n pluginSettingsPanels: (...args: Parameters<typeof pluginSettingsPanels>) =>\n pluginSettingsPanels(...args).map(owner),\n slotFills: (...args: Parameters<typeof slotFills>) => slotFills(...args).map(owner),\n workspaceSlotFills: (...args: Parameters<typeof workspaceSlotFills>) => workspaceSlotFills(...args).map(owner),\n globalSlotFills: (...args: Parameters<typeof globalSlotFills>) => globalSlotFills(...args).map(owner),\n dashboardTileFills: (...args: Parameters<typeof dashboardTileFills>) => dashboardTileFills(...args).map(owner),\n legacyHomeAppFills: () => legacyHomeAppFills().map(owner),\n pluginHomeContributions: (...args: Parameters<typeof pluginHomeContributions>) =>\n pluginHomeContributions(...args).map(owner),\n paletteCommands,\n pluginContextActions: (...args: Parameters<typeof pluginContextActions>) =>\n pluginContextActions(...args).map(owner),\n pluginUserMessageActions: (...args: Parameters<typeof pluginUserMessageActions>) =>\n pluginUserMessageActions(...args).map(owner),\n pluginLeaderBindings,\n pluginSelectionAxes,\n pluginMinorModes,\n pluginActivityGroups,\n pluginFileLinks,\n pluginToolRenderer,\n pluginMcpAppRenderer,\n sessionToolRenderer,\n sessionWebPluginsInstalled,\n dispatchChannelFrame,\n dropPluginSessionData,\n startPluginDefinitions,\n startWebPlugins,\n };\n}\n\nexport type WebPluginRegistry = ReturnType<typeof createWebPluginRegistry>;\nconst defaultRegistry = createWebPluginRegistry();\nconst hostRegistries = new Map<string, WebPluginRegistry>();\nlet activeHostId: string | undefined;\nexport function webPluginRegistryForHost(hostId: string): WebPluginRegistry {\n let registry = hostRegistries.get(hostId);\n if (!registry) {\n registry = observeRegistry(createWebPluginRegistry(hostId));\n hostRegistries.set(hostId, registry);\n }\n return registry;\n}\nexport function removeHostWebPlugins(hostId: string): void {\n hostRegistries.get(hostId)?.resetWebPlugins();\n hostRegistries.delete(hostId);\n if (activeHostId === hostId) activeHostId = undefined;\n}\n\nconst registrySubscribers = new Set<() => void>();\nfunction notifyRegistrySubscribers(): void {\n noteStoreUpdate('pluginRegistry', combinedRevision, combinedRevision + 1);\n for (const listener of registrySubscribers) listener();\n}\nlet combinedRevision = 0;\nconst observedRegistries = new WeakSet<WebPluginRegistry>();\nfunction observeRegistry(registry: WebPluginRegistry): WebPluginRegistry {\n if (!observedRegistries.has(registry)) {\n observedRegistries.add(registry);\n registry.subscribeWebPluginRegistry(() => {\n combinedRevision += 1;\n notifyRegistrySubscribers();\n });\n }\n return registry;\n}\n/** Selects host-owned global surfaces when no session or workspace is focused. */\nexport function activateWebPluginHost(hostId: string | undefined): void {\n if (activeHostId === hostId) return;\n activeHostId = hostId;\n combinedRevision += 1;\n notifyRegistrySubscribers();\n}\n\nfunction selectedRegistry(): WebPluginRegistry {\n return activeHostId === undefined ? defaultRegistry : webPluginRegistryForHost(activeHostId);\n}\nfunction registryForKey(key: string): WebPluginRegistry {\n const qualified = splitHostId(key);\n return observeRegistry(qualified === undefined ? defaultRegistry : webPluginRegistryForHost(qualified.hostId));\n}\nfunction registryForMount(mount?: WebPluginMount): WebPluginRegistry {\n return mount === undefined || mount.scope === 'host'\n ? selectedRegistry()\n : registryForKey(mount.scope === 'session' ? mount.sessionId : mount.workspaceId);\n}\n\nexport const webTemplateCatalog: WebPluginRegistry['webTemplateCatalog'] = (...args) =>\n registryForMount(args[0]).webTemplateCatalog(...args);\n\nexport const nativeTemplateCatalog: WebPluginRegistry['nativeTemplateCatalog'] = (...args) =>\n registryForMount(args[0]).nativeTemplateCatalog(...args);\n\nexport const installGlobalWebPlugins: WebPluginRegistry['installGlobalWebPlugins'] = (...args) =>\n selectedRegistry().installGlobalWebPlugins(...args);\n\nexport const installWorkspaceWebPlugins: WebPluginRegistry['installWorkspaceWebPlugins'] = (...args) =>\n registryForKey(args[0]).installWorkspaceWebPlugins(...args);\n\nexport const removeWorkspaceWebPlugins: WebPluginRegistry['removeWorkspaceWebPlugins'] = (...args) =>\n registryForKey(args[0]).removeWorkspaceWebPlugins(...args);\n\nexport const bindSessionWebWorkspace: WebPluginRegistry['bindSessionWebWorkspace'] = (...args) =>\n registryForKey(args[0]).bindSessionWebWorkspace(...args);\n\nexport const installWebPlugins: WebPluginRegistry['installWebPlugins'] = (...args) =>\n selectedRegistry().installWebPlugins(...args);\n\nexport const webPluginsInstalled: WebPluginRegistry['webPluginsInstalled'] = (...args) =>\n selectedRegistry().webPluginsInstalled(...args);\n\nexport const installSessionWebPlugins: WebPluginRegistry['installSessionWebPlugins'] = (...args) =>\n registryForKey(args[0]).installSessionWebPlugins(...args);\n\nexport const removeSessionWebPlugins: WebPluginRegistry['removeSessionWebPlugins'] = (...args) =>\n registryForKey(args[0]).removeSessionWebPlugins(...args);\n\nexport const setWebPluginLoadDiagnostics: WebPluginRegistry['setWebPluginLoadDiagnostics'] = (...args) =>\n registryForMount(args[0]).setWebPluginLoadDiagnostics(...args);\n\nexport const webPluginDiagnostics: WebPluginRegistry['webPluginDiagnostics'] = (...args) =>\n selectedRegistry().webPluginDiagnostics(...args);\n\nexport const installedWebPlugins: WebPluginRegistry['installedWebPlugins'] = (...args) =>\n selectedRegistry().installedWebPlugins(...args);\n\nexport const pluginRepositorySettingsPanels: WebPluginRegistry['pluginRepositorySettingsPanels'] = (...args) =>\n selectedRegistry().pluginRepositorySettingsPanels(...args);\n\nexport const webTabs: WebPluginRegistry['webTabs'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).webTabs(...args);\n\nexport const pluginDockFaces: WebPluginRegistry['pluginDockFaces'] = (...args) =>\n selectedRegistry().pluginDockFaces(...args);\n\nexport const isDesktopClient: WebPluginRegistry['isDesktopClient'] = (...args) =>\n selectedRegistry().isDesktopClient(...args);\n\nexport const pluginSettingsSections: WebPluginRegistry['pluginSettingsSections'] = (...args) =>\n selectedRegistry().pluginSettingsSections(...args);\n\nexport const pluginSettingsPanels: WebPluginRegistry['pluginSettingsPanels'] = (...args) =>\n selectedRegistry().pluginSettingsPanels(...args);\n\nexport const slotFills: WebPluginRegistry['slotFills'] = (...args) =>\n (typeof args[1] === 'string' ? registryForKey(args[1]) : selectedRegistry()).slotFills(...args);\n\nexport const workspaceSlotFills: WebPluginRegistry['workspaceSlotFills'] = (...args) =>\n registryForKey(args[0]).workspaceSlotFills(...args);\n\n/** The themes this browser's own global plugins contribute; a remote host's themes are not the person's. */\nexport function pluginThemes(): readonly InstalledPluginTheme[] {\n return defaultRegistry.pluginThemes();\n}\n\n/**\n * The themes the person's paired computers contribute, for the phone, which pairs only with their\n * own computers. One plugin on two computers is offered once, under its first computer's colours.\n */\nexport function allPluginThemes(): readonly InstalledPluginTheme[] {\n const seen = new Set<string>();\n return [defaultRegistry, ...hostRegistries.values()]\n .flatMap((registry) => registry.pluginThemes())\n .filter(({ theme }) => {\n if (seen.has(theme.name)) return false;\n seen.add(theme.name);\n return true;\n });\n}\n\n/** All host-global providers, default first then host registry creation order, independent of focus. */\nexport function globalPluginProviders(): readonly InstalledGlobalPluginProvider[] {\n return [defaultRegistry, ...hostRegistries.values()].flatMap((registry) => registry.globalPluginProviders());\n}\n\nexport const globalSlotFills: WebPluginRegistry['globalSlotFills'] = (...args) =>\n selectedRegistry().globalSlotFills(...args);\n\nexport const dashboardTileFills: WebPluginRegistry['dashboardTileFills'] = (...args) =>\n registryForMount(args[0]).dashboardTileFills(...args);\n\nexport const legacyHomeAppFills: WebPluginRegistry['legacyHomeAppFills'] = () =>\n selectedRegistry().legacyHomeAppFills();\n\nexport const pluginHomeContributions: WebPluginRegistry['pluginHomeContributions'] = (...args) =>\n registryForMount(args[0]).pluginHomeContributions(...args);\n\nexport const paletteCommands: WebPluginRegistry['paletteCommands'] = (...args) =>\n selectedRegistry().paletteCommands(...args);\n\nexport const pluginContextActions: WebPluginRegistry['pluginContextActions'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginContextActions(...args);\n\nexport const pluginUserMessageActions: WebPluginRegistry['pluginUserMessageActions'] = (...args) =>\n selectedRegistry().pluginUserMessageActions(...args);\n\nexport const pluginLeaderBindings: WebPluginRegistry['pluginLeaderBindings'] = (...args) =>\n selectedRegistry().pluginLeaderBindings(...args);\n\nexport const pluginSelectionAxes: WebPluginRegistry['pluginSelectionAxes'] = (...args) =>\n selectedRegistry().pluginSelectionAxes(...args);\n\nexport const pluginMinorModes: WebPluginRegistry['pluginMinorModes'] = (...args) =>\n selectedRegistry().pluginMinorModes(...args);\n\nexport const pluginActivityGroups: WebPluginRegistry['pluginActivityGroups'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginActivityGroups(...args);\n\nexport const pluginFileLinks: WebPluginRegistry['pluginFileLinks'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginFileLinks(...args);\n\nexport const pluginToolRenderer: WebPluginRegistry['pluginToolRenderer'] = (...args) =>\n selectedRegistry().pluginToolRenderer(...args);\n\nexport const sessionToolRenderer: WebPluginRegistry['sessionToolRenderer'] = (...args) =>\n registryForKey(args[0]).sessionToolRenderer(...args);\n\nexport const sessionWebPluginsInstalled: WebPluginRegistry['sessionWebPluginsInstalled'] = (...args) =>\n registryForKey(args[0]).sessionWebPluginsInstalled(...args);\n\nexport const dispatchChannelFrame: WebPluginRegistry['dispatchChannelFrame'] = (...args) =>\n (typeof args[0].sessionId === 'string' ? registryForKey(args[0].sessionId) : selectedRegistry()).dispatchChannelFrame(\n ...args,\n );\n\nexport const dropPluginSessionData: WebPluginRegistry['dropPluginSessionData'] = (...args) =>\n registryForKey(args[0]).dropPluginSessionData(...args);\n\nexport const startPluginDefinitions: WebPluginRegistry['startPluginDefinitions'] = (...args) =>\n selectedRegistry().startPluginDefinitions(...args);\n\nexport const startWebPlugins: WebPluginRegistry['startWebPlugins'] = (...args) =>\n selectedRegistry().startWebPlugins(...args);\n\nexport function subscribeWebPluginRegistry(listener: () => void): () => void {\n observeRegistry(defaultRegistry);\n registrySubscribers.add(listener);\n return () => registrySubscribers.delete(listener);\n}\nexport function webPluginRegistryRevision(): number {\n return combinedRevision;\n}\nexport function activateWebPluginSession(sessionId: string | null): void {\n const nextHost = sessionId === null ? activeHostId : splitHostId(sessionId)?.hostId;\n const changed = activeHostId !== nextHost;\n activeHostId = nextHost;\n observeRegistry(selectedRegistry()).activateWebPluginSession(sessionId);\n if (changed) {\n combinedRevision += 1;\n notifyRegistrySubscribers();\n }\n}\nexport function activateWebPluginWorkspace(workspaceId: string | null): void {\n const nextHost = workspaceId === null ? activeHostId : splitHostId(workspaceId)?.hostId;\n const changed = activeHostId !== nextHost;\n activeHostId = nextHost;\n observeRegistry(selectedRegistry()).activateWebPluginWorkspace(workspaceId);\n if (changed) {\n combinedRevision += 1;\n notifyRegistrySubscribers();\n }\n}\nexport function resetWebPlugins(): void {\n for (const registry of hostRegistries.values()) registry.resetWebPlugins();\n hostRegistries.clear();\n activeHostId = undefined;\n observeRegistry(defaultRegistry).resetWebPlugins();\n}\n\nexport const pluginMcpAppRenderer: WebPluginRegistry['pluginMcpAppRenderer'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginMcpAppRenderer(...args);\n"],"mappings":";;;;;;;;;;AAyGA,SAAgB,uBAAuB,OAA0C;CAC/E,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GAAG,OAAO;CAChF,MAAM,OAAO;CACb,IAAI,KAAK,YAAY,KAAK,OAAO,KAAK,UAAU,YAAY,KAAK,MAAM,KAAK,MAAM,IAAI,OAAO;CAC7F,IAAI,KAAK,SAAS,KAAA,KAAa,CAAC;EAAC;EAAS;EAAQ;EAAQ;CAAO,CAAC,CAAC,SAAS,KAAK,IAAc,GAAG,OAAO;CACzG,IAAI,KAAK,WAAW,KAAA,KAAa,KAAK,WAAW,UAAU,KAAK,WAAW,QAAQ,OAAO;CAC1F,IACE,KAAK,SAAS,KAAA,KACd,OAAO,KAAK,SAAS,eACpB,OAAO,KAAK,SAAS,YAAY,KAAK,SAAS,OAEhD,OAAO;CACT,IAAI,KAAK,sBAAsB,KAAA,KAAa,OAAO,KAAK,sBAAsB,WAAW,OAAO;CAChG,IACE,KAAK,aAAa,KAAA,MACjB,CAAC,MAAM,QAAQ,KAAK,QAAQ,KAAK,KAAK,SAAS,MAAM,YAAY,YAAY,UAAU,YAAY,WAAW,IAE/G,OAAO;CACT,IAAI,KAAK,SAAS,KAAA,GAAW;EAC3B,IAAI,OAAO,KAAK,SAAS,YAAY,KAAK,SAAS,QAAQ,MAAM,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,wBAAmE,GAAG,UAChF,OAAO,KAAK,OAAO,WAAW,eAAe,KAAK,EAAE,IAAI,iBAAiB,EAAA,CAAG,qBAAqB,GAAG,IAAI"}
1
+ {"version":3,"file":"pluginRegistry.cjs","names":["HOST_SLOTS","collectWebTemplates","mergeScopedPlugins","collectNativeTemplates","collectPluginThemes","pluginsAtScope","qualifyHostId","leaderConflicts","parseHomeContribution","activityGroupSlot","isSelfHostShell","splitHostId"],"sources":["../../../src/web/lib/pluginRegistry.ts"],"sourcesContent":["import type {\n ActivityGroupContribution,\n ContextActionContribution,\n DashboardTileData,\n DockFaceContribution,\n FileLinkSource,\n LeaderBindingContribution,\n MinorModeContribution,\n PaletteCommandContribution,\n RepositorySettingsPanelContribution,\n SettingsPanelContribution,\n SettingsSectionContribution,\n SelectionAxisContribution,\n SessionChannelContribution,\n SlotDeclaration,\n SlotFillContribution,\n SurfaceContribution,\n TabContribution,\n ToolRendererContribution,\n UserMessageActionContribution,\n WebPluginDefinition,\n WebPluginMount,\n WebPluginRuntime,\n WebPluginSlotProps,\n} from '@agimon-ai/po-core/web';\nimport { activityGroupSlot, HOST_SLOTS, parseHomeContribution, type HomeContribution } from '@agimon-ai/po-core/web';\nexport { activityGroupSlot, HOST_SLOTS } from '@agimon-ai/po-core/web';\nimport type { ComponentType, ReactNode } from 'react';\n\nimport { qualifyHostId, splitHostId } from './hostIdentity';\nimport { leaderConflicts } from './leaderTree';\nimport { mergeScopedPlugins, pluginsAtScope } from './pluginScopes';\nimport { collectPluginThemes, type InstalledPluginTheme } from './pluginThemes';\nimport { isSelfHostShell } from './selfHostShell';\nimport {\n collectNativeTemplates,\n collectWebTemplates,\n type NativeTemplateCatalog,\n type WebTemplateCatalog,\n} from './templateCatalog';\nimport { noteStoreUpdate } from './uiTrace';\n\n/**\n * The installed plugin set.\n *\n * Plain module state rather than a reactive store: the generated plugin list\n * is installed once at startup, before the first render, so every read during\n * render is stable. Install runs in two phases. The first collects every\n * plugin's contributions in the generated order, which is (registrationOrder,\n * pluginId); the second resolves every relation between plugins by name, so\n * a plugin may fill a slot whichever of the two installs first.\n *\n * Plugins are independent and a user may install any of them, so a collision\n * between two plugins never fails the install: a shared name goes to the\n * first plugin (a Leader Space leaf to the later one, as the TUI documents)\n * and the loser is recorded as a diagnostic. Only a malformed contribution\n * inside one plugin throws, because that is a developer error its own tests\n * catch. resetWebPlugins exists for unit tests only.\n */\n\nexport type InstallDiagnosticKind =\n | 'duplicate-plugin'\n | 'duplicate-tab'\n | 'duplicate-dock-face'\n | 'duplicate-channel'\n | 'duplicate-tool'\n | 'duplicate-activity-group'\n | 'duplicate-minor-mode'\n | 'duplicate-selection-axis'\n | 'duplicate-palette-command'\n | 'duplicate-settings-section'\n | 'leader-leaf-override'\n | 'leader-group-label'\n | 'orphan-fill'\n | 'rejected-fill'\n | 'rejected-theme'\n | 'duplicate-theme'\n | 'invalid-template'\n | 'duplicate-template'\n | 'slot-load-failed'\n | 'start-failed'\n | 'invalid-plugin';\n\nexport interface InstallDiagnostic {\n /** The plugin that lost or misfiled the contribution. */\n pluginId: string;\n kind: InstallDiagnosticKind;\n message: string;\n}\n\n/** One placed fill, as the owner's renderSlot and slotData read it. */\nexport interface ResolvedFill {\n slot: string;\n pluginId: string;\n id: string;\n order: number;\n data?: unknown;\n component?: ComponentType<WebPluginSlotProps>;\n}\n\nexport interface InstalledDashboardTile extends ResolvedFill {\n data: DashboardTileData;\n}\n\n/** Reject malformed tile presentation without executing its body. */\nexport function parseDashboardTileData(input: unknown): DashboardTileData | null {\n if (typeof input !== 'object' || input === null || Array.isArray(input)) return null;\n const data = input as Record<string, unknown>;\n if (data.version !== 1 || typeof data.title !== 'string' || data.title.trim() === '') return null;\n if (data.size !== undefined && !['small', 'wide', 'tall', 'large'].includes(data.size as string)) return null;\n if (data.column !== undefined && data.column !== 'main' && data.column !== 'side') return null;\n if (\n data.icon !== undefined &&\n typeof data.icon !== 'function' &&\n (typeof data.icon !== 'object' || data.icon === null)\n )\n return null;\n if (data.combinesComputers !== undefined && typeof data.combinesComputers !== 'boolean') return null;\n if (data.dataScope !== undefined && data.dataScope !== 'host' && data.dataScope !== 'global') return null;\n if (\n data.surfaces !== undefined &&\n (!Array.isArray(data.surfaces) || data.surfaces.some((surface) => surface !== 'home' && surface !== 'workspace'))\n )\n return null;\n if (data.open !== undefined) {\n if (typeof data.open !== 'object' || data.open === null || Array.isArray(data.open)) return null;\n const open = data.open as Record<string, unknown>;\n if ((open.kind !== 'page' && open.kind !== 'settings') || typeof open.id !== 'string' || open.id.trim() === '')\n return null;\n }\n return input as DashboardTileData;\n}\n\nexport interface InstalledContextAction extends ContextActionContribution {\n pluginId: string;\n}\n\nexport interface InstalledUserMessageAction extends UserMessageActionContribution {\n pluginId: string;\n}\n\nconst SLOT_SEPARATOR = '.';\nconst DEFAULT_FILL_ORDER = 1000;\nconst RESERVED_PLUGIN_IDS: ReadonlySet<string> = new Set(Object.values(HOST_SLOTS));\n\ninterface RegistryState {\n plugins: WebPluginDefinition[];\n tabs: TabContribution[];\n dockFaces: DockFaceContribution[];\n channels: Map<string, SessionChannelContribution>;\n commands: PaletteCommandContribution[];\n contextActions: InstalledContextAction[];\n userMessageActions: InstalledUserMessageAction[];\n leaderBindings: LeaderBindingContribution[];\n selectionAxes: SelectionAxisContribution[];\n minorModes: MinorModeContribution[];\n activityGroups: ActivityGroupContribution[];\n settingsSections: SettingsSectionContribution[];\n settingsPanels: InstalledSettingsPanel[];\n toolRenderers: Map<string, ToolRendererContribution>;\n toolMatchers: ToolRendererContribution[];\n slots: Map<string, SlotDeclaration>;\n fills: Map<string, ResolvedFill[]>;\n fileLinks: FileLinkSource[];\n diagnostics: InstallDiagnostic[];\n}\n\nfunction emptyState(): RegistryState {\n return {\n plugins: [],\n tabs: [],\n dockFaces: [],\n channels: new Map(),\n commands: [],\n contextActions: [],\n userMessageActions: [],\n leaderBindings: [],\n selectionAxes: [],\n minorModes: [],\n activityGroups: [],\n settingsSections: [],\n settingsPanels: [],\n toolRenderers: new Map(),\n toolMatchers: [],\n slots: new Map(),\n fills: new Map(),\n fileLinks: [],\n diagnostics: [],\n };\n}\n\nexport interface InstalledRepositorySettingsPanel extends RepositorySettingsPanelContribution {\n pluginId: string;\n}\nexport interface InstalledSettingsPanel extends SettingsPanelContribution {\n pluginId: string;\n}\nexport interface InstalledGlobalPluginProvider {\n pluginId: string;\n provider: ComponentType<{ children?: ReactNode }>;\n}\n\nexport interface InstalledHomeContribution {\n pluginId: string;\n id: string;\n order: number;\n data: HomeContribution;\n mount: Exclude<WebPluginMount, { scope: 'session' }>;\n}\n\n/** An independently owned host plugin registry. */\nexport function createWebPluginRegistry(hostId?: string) {\n let defaultState = emptyState();\n let installingState = defaultState;\n let defaultInstalled = false;\n let providers: readonly InstalledGlobalPluginProvider[] = [];\n let themes: readonly InstalledPluginTheme[] = [];\n const sessionStates = new Map<string, RegistryState>();\n const workspaceStates = new Map<string, RegistryState>();\n const sessionPlugins = new Map<string, readonly WebPluginDefinition[]>();\n const sessionWorkspaces = new Map<string, string>();\n let activeWorkspaceId: string | null = null;\n const pendingSessionFrames = new Map<string, Map<string, Record<string, unknown>>>();\n const MAX_PENDING_CHANNEL_TYPES = 64;\n let activeSessionId: string | null = null;\n /** Slots each mount could not load, keyed `global`, `workspace:<id>` or `session:<id>`. */\n const loadDiagnostics = new Map<string, readonly InstallDiagnostic[]>();\n let registryRevision = 0;\n const registryListeners = new Set<() => void>();\n\n function activeState(sessionId?: string | null): RegistryState {\n if (sessionId !== undefined && sessionId !== null) {\n const workspaceId = sessionWorkspaces.get(sessionId);\n return (\n sessionStates.get(sessionId) ??\n (workspaceId === undefined ? undefined : workspaceStates.get(workspaceId)) ??\n defaultState\n );\n }\n return (\n (activeSessionId === null ? undefined : sessionStates.get(activeSessionId)) ?? workspaceState() ?? defaultState\n );\n }\n\n function workspaceState(): RegistryState | undefined {\n return activeWorkspaceId === null ? undefined : workspaceStates.get(activeWorkspaceId);\n }\n\n /** Settings requests an explicit scope; the cockpit reads its active session composition. */\n function webTemplateCatalog(mount?: WebPluginMount): WebTemplateCatalog {\n if (mount === undefined) {\n const scope = activeSessionId === null ? (activeWorkspaceId === null ? 'host' : 'workspace') : 'session';\n return collectWebTemplates(activeState().plugins, scope);\n }\n if (mount.scope === 'host') return collectWebTemplates(defaultState.plugins, 'host');\n const workspace = workspaceStates.get(mount.workspaceId);\n const plugins = mount.scope === 'session' ? sessionStates.get(mount.sessionId)?.plugins : undefined;\n return collectWebTemplates(\n plugins ?? mergeScopedPlugins(defaultState.plugins, workspace?.plugins ?? []),\n mount.scope,\n );\n }\n\n /** The phone app's layouts at the server-resolved `native.template` mount. */\n function nativeTemplateCatalog(mount: WebPluginMount): NativeTemplateCatalog {\n if (mount.scope === 'host') return collectNativeTemplates(defaultState.plugins, 'host');\n const workspace = workspaceStates.get(mount.workspaceId);\n const plugins = mount.scope === 'session' ? sessionStates.get(mount.sessionId)?.plugins : undefined;\n return collectNativeTemplates(\n plugins ?? mergeScopedPlugins(defaultState.plugins, workspace?.plugins ?? []),\n mount.scope,\n );\n }\n function rebuildSession(sessionId: string): RegistryState {\n const previous = sessionStates.get(sessionId);\n const workspaceId = sessionWorkspaces.get(sessionId);\n const workspace = workspaceId === undefined ? undefined : workspaceStates.get(workspaceId);\n const state = buildLiveState(\n mergeScopedPlugins(defaultState.plugins, workspace?.plugins ?? [], sessionPlugins.get(sessionId) ?? []),\n );\n sessionStates.set(sessionId, state);\n // Drop stale stores before replay, since replacement channels may share a store.\n for (const [type, channel] of previous?.channels.entries() ?? [])\n if (state.channels.get(type) !== channel) channel.drop(sessionId);\n const pending = pendingSessionFrames.get(sessionId);\n if (pending !== undefined) {\n for (const [type, frame] of pending) if (dispatchFrameToState(state, frame)) pending.delete(type);\n if (pending.size === 0) pendingSessionFrames.delete(sessionId);\n }\n return state;\n }\n\n /** Themes are the person's, so only the global plugins contribute them. */\n function installThemes(plugins: readonly WebPluginDefinition[]): void {\n const collected = collectPluginThemes(plugins);\n themes = collected.themes;\n defaultState.diagnostics.push(...collected.diagnostics);\n }\n\n function installGlobalWebPlugins(plugins: readonly WebPluginDefinition[]): void {\n defaultState = buildLiveState(pluginsAtScope(plugins, 'host'), plugins);\n providers = defaultState.plugins.flatMap((plugin) => {\n const provider = plugins.find((definition) => definition.id === plugin.id)?.host?.provider;\n return provider === undefined\n ? []\n : [{ pluginId: hostId === undefined ? plugin.id : qualifyHostId(hostId, plugin.id), provider }];\n });\n installThemes(plugins);\n for (const id of sessionStates.keys()) rebuildSession(id);\n emitRegistryChange();\n }\n\n function installWorkspaceWebPlugins(workspaceId: string, plugins: readonly WebPluginDefinition[]): void {\n const state = buildLiveState(pluginsAtScope(plugins, 'workspace'), plugins);\n workspaceStates.set(workspaceId, state);\n for (const [id, owner] of sessionWorkspaces) if (owner === workspaceId) rebuildSession(id);\n emitRegistryChange();\n }\n\n function removeWorkspaceWebPlugins(workspaceId: string): void {\n workspaceStates.delete(workspaceId);\n loadDiagnostics.delete(`workspace:${workspaceId}`);\n for (const [id, owner] of sessionWorkspaces) if (owner === workspaceId) rebuildSession(id);\n if (activeWorkspaceId === workspaceId) activeWorkspaceId = null;\n emitRegistryChange();\n }\n\n function activateWebPluginWorkspace(workspaceId: string | null): void {\n if (activeWorkspaceId === workspaceId) return;\n activeWorkspaceId = workspaceId;\n emitRegistryChange();\n }\n\n function bindSessionWebWorkspace(sessionId: string, workspaceId: string): void {\n sessionWorkspaces.set(sessionId, workspaceId);\n rebuildSession(sessionId);\n }\n\n function emitRegistryChange(): void {\n registryRevision += 1;\n for (const listener of registryListeners) listener();\n }\n\n /** The TUI's leader alphabet: one lowercase letter or digit per segment. */\n const LEADER_KEY = /^[a-z0-9]$/;\n const MAX_LEADER_PATH = 4;\n\n /**\n * A malformed binding fails the install rather than the keypress: the plugin\n * set is generated at build time, so this is a developer error, and the TUI's\n * registry refuses the same shapes.\n */\n function checkLeaderBinding(pluginId: string, binding: LeaderBindingContribution): void {\n if (binding.path.length === 0 || binding.path.length > MAX_LEADER_PATH) {\n throw new Error(\n `Web plugin '${pluginId}' leader binding '${binding.id}' needs 1 to ${MAX_LEADER_PATH} path segments.`,\n );\n }\n for (const segment of binding.path) {\n if (!LEADER_KEY.test(segment.key)) {\n throw new Error(\n `Web plugin '${pluginId}' leader binding '${binding.id}' key '${segment.key}' must be one lowercase letter or digit.`,\n );\n }\n if (segment.label.trim() === '') {\n throw new Error(`Web plugin '${pluginId}' leader binding '${binding.id}' has an unlabeled segment.`);\n }\n }\n }\n\n interface PendingFill {\n pluginId: string;\n fill: SlotFillContribution;\n }\n\n interface PendingSection {\n pluginId: string;\n section: SurfaceContribution;\n }\n\n interface PendingBinding {\n pluginId: string;\n binding: LeaderBindingContribution;\n }\n\n type SharedNamespace =\n | 'plugin'\n | 'tab'\n | 'dock-face'\n | 'channel'\n | 'tool'\n | 'activity-group'\n | 'minor-mode'\n | 'selection-axis'\n | 'palette-command'\n | 'settings-section';\n\n /**\n * Claims `id` in one shared namespace: false, with a diagnostic, when another\n * plugin already holds it; a throw when this plugin declared it twice, which\n * is a developer error rather than a composition.\n */\n function claim(owners: Map<string, string>, thing: SharedNamespace, id: string, pluginId: string): boolean {\n const holder = owners.get(id);\n if (holder === pluginId) {\n throw new Error(`Web plugin '${pluginId}' declares ${thing.replace('-', ' ')} '${id}' twice.`);\n }\n if (holder !== undefined) {\n installingState.diagnostics.push({\n pluginId,\n kind: `duplicate-${thing}`,\n message: `Web plugin '${pluginId}' ${thing.replace('-', ' ')} '${id}' is already provided by '${holder}'; keeping the first.`,\n });\n return false;\n }\n owners.set(id, pluginId);\n return true;\n }\n\n function surfaceFill(slot: string, surface: SurfaceContribution): SlotFillContribution {\n return { slot, id: surface.id, component: surface.component };\n }\n\n function checkSlotDeclaration(pluginId: string, declared: Set<string>, declaration: SlotDeclaration): void {\n const prefix = `${pluginId}${SLOT_SEPARATOR}`;\n if (!declaration.slot.startsWith(prefix) || declaration.slot.length === prefix.length) {\n throw new Error(\n `Web plugin '${pluginId}' declares slot '${declaration.slot}', which must be named '${prefix}<name>'.`,\n );\n }\n if (declared.has(declaration.slot)) {\n throw new Error(`Web plugin '${pluginId}' declares slot '${declaration.slot}' twice.`);\n }\n declared.add(declaration.slot);\n }\n\n function checkFill(pluginId: string, seen: Set<string>, fill: SlotFillContribution): void {\n if (fill.id === '') throw new Error(`Web plugin '${pluginId}' has a fill into '${fill.slot}' with an empty id.`);\n if (fill.component === undefined && fill.data === undefined) {\n throw new Error(\n `Web plugin '${pluginId}' fill '${fill.id}' into '${fill.slot}' has neither a component nor data.`,\n );\n }\n const key = `${fill.slot} ${fill.id}`;\n if (seen.has(key)) throw new Error(`Web plugin '${pluginId}' fills '${fill.slot}' with id '${fill.id}' twice.`);\n seen.add(key);\n }\n\n function checkContextAction(pluginId: string, seen: Set<string>, action: ContextActionContribution): void {\n if (action.id.trim() === '') throw new Error(`Web plugin '${pluginId}' has a context action with an empty id.`);\n if (seen.has(action.id)) throw new Error(`Web plugin '${pluginId}' declares context action '${action.id}' twice.`);\n if (action.label.trim() === '')\n throw new Error(`Web plugin '${pluginId}' context action '${action.id}' has an empty label.`);\n if (action.kinds.length === 0 || action.kinds.some((kind) => kind.trim() === '')) {\n throw new Error(`Web plugin '${pluginId}' context action '${action.id}' needs non-empty kinds.`);\n }\n seen.add(action.id);\n }\n\n function checkUserMessageAction(pluginId: string, seen: Set<string>, action: UserMessageActionContribution): void {\n if (action.id.trim() === '')\n throw new Error(`Web plugin '${pluginId}' has a user message action with an empty id.`);\n if (seen.has(action.id))\n throw new Error(`Web plugin '${pluginId}' declares user message action '${action.id}' twice.`);\n if (action.label.trim() === '')\n throw new Error(`Web plugin '${pluginId}' user message action '${action.id}' has an empty label.`);\n seen.add(action.id);\n }\n\n const byFillOrder = (left: ResolvedFill, right: ResolvedFill): number =>\n left.order - right.order || left.pluginId.localeCompare(right.pluginId) || left.id.localeCompare(right.id);\n\n const byDisplayOrder = (left: { order?: number; name: string }, right: { order?: number; name: string }): number =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) || left.name.localeCompare(right.name);\n\n function placeFill(pluginId: string, fill: SlotFillContribution): void {\n const declaration = installingState.slots.get(fill.slot);\n if (declaration === undefined) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'orphan-fill',\n message: `Web plugin '${pluginId}' fills slot '${fill.slot}', which no installed plugin declares; nothing is placed.`,\n });\n return;\n }\n let data = fill.data;\n if (data !== undefined && declaration.parse !== undefined) {\n const parsed = declaration.parse(data);\n if (parsed === null) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'rejected-fill',\n message: `Web plugin '${pluginId}' fill '${fill.id}' into '${fill.slot}' was rejected by the slot's parse gate.`,\n });\n return;\n }\n data = parsed;\n }\n const placed: ResolvedFill = {\n slot: fill.slot,\n pluginId,\n id: fill.id,\n order: fill.order ?? DEFAULT_FILL_ORDER,\n ...(data === undefined ? {} : { data }),\n ...(fill.component === undefined ? {} : { component: fill.component }),\n };\n const list = installingState.fills.get(fill.slot);\n if (list === undefined) installingState.fills.set(fill.slot, [placed]);\n else list.push(placed);\n }\n\n function resolveLeaderConflicts(bindings: readonly PendingBinding[]): void {\n const owner = new Map<LeaderBindingContribution, string>(bindings.map((entry) => [entry.binding, entry.pluginId]));\n for (const conflict of leaderConflicts(bindings.map((entry) => entry.binding))) {\n const winner = owner.get(conflict.winner) ?? '';\n const loser = owner.get(conflict.loser) ?? '';\n if (winner === loser) {\n throw new Error(\n `Web plugin '${winner}' binds Leader Space '${conflict.path}' twice ('${conflict.loser.id}' and '${conflict.winner.id}').`,\n );\n }\n if (conflict.kind === 'leaf-override') {\n installingState.diagnostics.push({\n pluginId: loser,\n kind: 'leader-leaf-override',\n message: `Web plugin '${loser}' Leader Space leaf '${conflict.path}' ('${conflict.loser.id}') is taken over by '${winner}' ('${conflict.winner.id}').`,\n });\n } else {\n installingState.diagnostics.push({\n pluginId: loser,\n kind: 'leader-group-label',\n message: `Web plugin '${loser}' words Leader Space group '${conflict.path}' differently from '${winner}', which named it first; keeping the first label.`,\n });\n }\n }\n }\n\n function buildWebPluginState(\n plugins: readonly WebPluginDefinition[],\n definitions: readonly WebPluginDefinition[] = plugins,\n ): RegistryState {\n const previous = installingState;\n installingState = emptyState();\n try {\n const owners: Record<SharedNamespace, Map<string, string>> = {\n plugin: new Map(),\n tab: new Map(),\n 'dock-face': new Map(),\n channel: new Map(),\n tool: new Map(),\n 'activity-group': new Map(),\n 'minor-mode': new Map(),\n 'selection-axis': new Map(),\n 'palette-command': new Map(),\n 'settings-section': new Map(),\n };\n const pendingFills: PendingFill[] = [];\n const pendingSections: PendingSection[] = [];\n const pendingBindings: PendingBinding[] = [];\n const pendingSlots: SlotDeclaration[] = [];\n\n // Phase 1: collect, in the generated (registrationOrder, pluginId) order.\n for (const plugin of plugins) {\n if (RESERVED_PLUGIN_IDS.has(plugin.id)) {\n throw new Error(`Web plugin id '${plugin.id}' is reserved for a host slot.`);\n }\n if (owners.plugin.has(plugin.id)) {\n installingState.diagnostics.push({\n pluginId: plugin.id,\n kind: 'duplicate-plugin',\n message: `Web plugin id '${plugin.id}' is declared twice; keeping the first definition.`,\n });\n continue;\n }\n owners.plugin.set(plugin.id, plugin.id);\n installingState.plugins.push(plugin);\n for (const tab of plugin.tabs ?? []) {\n if (claim(owners.tab, 'tab', tab.id, plugin.id)) installingState.tabs.push(tab);\n }\n for (const face of plugin.dockFaces ?? []) {\n if (face.id === 'activity' || face.id === 'context') {\n throw new Error(`Web plugin '${plugin.id}' dock face '${face.id}' is reserved by the host.`);\n }\n if (face.id.trim() === '' || face.label.trim() === '') {\n throw new Error(`Web plugin '${plugin.id}' has an unlabeled dock face.`);\n }\n if (claim(owners['dock-face'], 'dock-face', face.id, plugin.id)) installingState.dockFaces.push(face);\n }\n // A panel and a section both become a /settings/:id route, so the two\n // share one id namespace rather than racing to own the same URL.\n for (const section of plugin.settingsSections ?? []) {\n if (claim(owners['settings-section'], 'settings-section', section.id, plugin.id)) {\n installingState.settingsSections.push(section);\n }\n }\n for (const panel of plugin.settingsPanels ?? []) {\n if (claim(owners['settings-section'], 'settings-section', panel.id, plugin.id)) {\n installingState.settingsPanels.push({ pluginId: plugin.id, ...panel });\n }\n }\n for (const channel of plugin.channels ?? []) {\n if (claim(owners.channel, 'channel', channel.channel, plugin.id))\n installingState.channels.set(channel.channel, channel);\n }\n for (const command of plugin.paletteCommands ?? []) {\n if (claim(owners['palette-command'], 'palette-command', command.id, plugin.id))\n installingState.commands.push(command);\n }\n const contextActions = new Set<string>();\n for (const action of plugin.contextActions ?? []) {\n checkContextAction(plugin.id, contextActions, action);\n installingState.contextActions.push({ pluginId: plugin.id, ...action });\n }\n const userMessageActions = new Set<string>();\n for (const action of plugin.userMessageActions ?? []) {\n checkUserMessageAction(plugin.id, userMessageActions, action);\n installingState.userMessageActions.push({ pluginId: plugin.id, ...action });\n }\n for (const binding of plugin.leaderBindings ?? []) {\n checkLeaderBinding(plugin.id, binding);\n pendingBindings.push({ pluginId: plugin.id, binding });\n }\n for (const axis of plugin.selectionAxes ?? []) {\n if (claim(owners['selection-axis'], 'selection-axis', axis.name, plugin.id))\n installingState.selectionAxes.push(axis);\n }\n for (const mode of plugin.minorModes ?? []) {\n if (claim(owners['minor-mode'], 'minor-mode', mode.name, plugin.id)) installingState.minorModes.push(mode);\n }\n for (const group of plugin.activityGroups ?? []) {\n if (claim(owners['activity-group'], 'activity-group', group.name, plugin.id))\n installingState.activityGroups.push(group);\n }\n for (const renderer of plugin.toolRenderers ?? []) {\n for (const tool of renderer.tools) {\n if (claim(owners.tool, 'tool', tool, plugin.id)) installingState.toolRenderers.set(tool, renderer);\n }\n if (renderer.matches !== undefined) installingState.toolMatchers.push(renderer);\n }\n const declared = new Set<string>();\n for (const declaration of plugin.slots ?? []) {\n checkSlotDeclaration(plugin.id, declared, declaration);\n pendingSlots.push(declaration);\n }\n const filled = new Set<string>();\n for (const fill of plugin.fills ?? []) {\n checkFill(plugin.id, filled, fill);\n pendingFills.push({ pluginId: plugin.id, fill });\n }\n for (const surface of plugin.overlays ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.overlay, surface) });\n }\n for (const surface of plugin.railSections ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.rail, surface) });\n }\n for (const surface of plugin.contextSections ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.context, surface) });\n }\n for (const surface of plugin.selectionBarItems ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.selectionBar, surface) });\n }\n for (const surface of plugin.composerActions ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.composerActions, surface) });\n }\n for (const surface of plugin.composerMenuItems ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.composerMenu, surface) });\n }\n for (const section of plugin.activitySections ?? []) pendingSections.push({ pluginId: plugin.id, section });\n if (plugin.fileLinks !== undefined) installingState.fileLinks.push(plugin.fileLinks);\n }\n\n installingState.diagnostics.push(...collectWebTemplates(installingState.plugins).diagnostics);\n\n // Phase 2: resolve by name, now that every declaration is known.\n for (const slot of Object.values(HOST_SLOTS)) installingState.slots.set(slot, { slot });\n installingState.slots.set(HOST_SLOTS.home, { slot: HOST_SLOTS.home, parse: parseHomeContribution });\n for (const group of installingState.activityGroups) {\n installingState.slots.set(activityGroupSlot(group.name), { slot: activityGroupSlot(group.name) });\n }\n for (const declaration of pendingSlots) installingState.slots.set(declaration.slot, declaration);\n for (const { pluginId, section } of pendingSections) {\n const keyed = activityGroupSlot(section.id);\n pendingFills.push({\n pluginId,\n fill: surfaceFill(installingState.slots.has(keyed) ? keyed : HOST_SLOTS.activity, section),\n });\n }\n for (const { pluginId, fill } of pendingFills) {\n if (\n fill.slot === HOST_SLOTS.dashboardTiles &&\n (parseDashboardTileData(fill.data) === null || fill.component === undefined)\n ) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'rejected-fill',\n message: `Web plugin '${pluginId}' dashboard tile '${fill.id}' needs valid presentation data and a body component.`,\n });\n continue;\n }\n if (fill.slot === HOST_SLOTS.home) {\n const data = parseHomeContribution(fill.data);\n const definition = definitions.find((plugin) => plugin.id === pluginId);\n const sources = [definition, definition?.host, definition?.workspace, definition?.session].flatMap(\n (contribution) => contribution?.channels ?? [],\n );\n if (data === null || !sources.some((channel) => channel.channel === data.source)) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'rejected-fill',\n message: `Web plugin '${pluginId}' Home fill '${fill.id}' needs valid data and an owned source channel.`,\n });\n continue;\n }\n }\n placeFill(pluginId, fill);\n }\n for (const list of installingState.fills.values()) list.sort(byFillOrder);\n\n resolveLeaderConflicts(pendingBindings);\n installingState.leaderBindings.push(...pendingBindings.map((entry) => entry.binding));\n installingState.contextActions.sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) ||\n left.pluginId.localeCompare(right.pluginId) ||\n left.id.localeCompare(right.id),\n );\n installingState.userMessageActions.sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) ||\n left.pluginId.localeCompare(right.pluginId) ||\n left.id.localeCompare(right.id),\n );\n installingState.selectionAxes.sort(byDisplayOrder);\n installingState.minorModes.sort(byDisplayOrder);\n installingState.activityGroups.sort(byDisplayOrder);\n installingState.dockFaces.sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) || left.id.localeCompare(right.id),\n );\n return installingState;\n } finally {\n installingState = previous;\n }\n }\n\n /**\n * Live mounts load developer plugins at runtime, so a plugin whose own build\n * throws is skipped with a diagnostic instead of blanking every other plugin.\n */\n function buildLiveState(\n plugins: readonly WebPluginDefinition[],\n definitions: readonly WebPluginDefinition[] = plugins,\n ): RegistryState {\n const rejected: InstallDiagnostic[] = [];\n const admitted = plugins.filter((plugin) => {\n try {\n buildWebPluginState([plugin], definitions);\n return true;\n } catch (error) {\n rejected.push({\n pluginId: plugin.id,\n kind: 'invalid-plugin',\n message: `Web plugin '${plugin.id}' was skipped: ${error instanceof Error ? error.message : String(error)}`,\n });\n return false;\n }\n });\n const state = buildWebPluginState(admitted, definitions);\n state.diagnostics.unshift(...rejected);\n return state;\n }\n\n function installWebPlugins(plugins: readonly WebPluginDefinition[]): void {\n if (defaultInstalled) throw new Error('Web plugins are already installed.');\n defaultState = buildWebPluginState(plugins);\n providers = defaultState.plugins.flatMap((plugin) => {\n const provider = plugin.host?.provider;\n return provider === undefined\n ? []\n : [{ pluginId: hostId === undefined ? plugin.id : qualifyHostId(hostId, plugin.id), provider }];\n });\n installThemes(plugins);\n installingState = defaultState;\n defaultInstalled = true;\n }\n\n function webPluginsInstalled(): boolean {\n return defaultInstalled;\n }\n\n /** Unit-test escape hatch; production installs exactly once. */\n function resetWebPlugins(): void {\n defaultState = emptyState();\n installingState = defaultState;\n defaultInstalled = false;\n providers = [];\n themes = [];\n sessionStates.clear();\n mcpAppRenderers.clear();\n workspaceStates.clear();\n sessionPlugins.clear();\n sessionWorkspaces.clear();\n activeWorkspaceId = null;\n pendingSessionFrames.clear();\n loadDiagnostics.clear();\n activeSessionId = null;\n emitRegistryChange();\n }\n\n /** Installs or atomically replaces one session's independently synchronized plugin definitions. */\n function installSessionWebPlugins(sessionId: string, plugins: readonly WebPluginDefinition[]): void {\n sessionPlugins.set(\n sessionId,\n plugins.flatMap((plugin) => (plugin.session === undefined ? [plugin] : pluginsAtScope([plugin], 'session'))),\n );\n rebuildSession(sessionId);\n // Background-session consumers also wait for their verified composition to arrive.\n emitRegistryChange();\n }\n\n /** Selects which session composition the no-argument contribution readers expose. */\n function activateWebPluginSession(sessionId: string | null): void {\n if (activeSessionId === sessionId) return;\n activeSessionId = sessionId;\n emitRegistryChange();\n }\n\n /** Removes one session registry after its plugin-owned stores have been dropped. */\n function removeSessionWebPlugins(sessionId: string): void {\n const sessionState = sessionStates.get(sessionId);\n pendingSessionFrames.delete(sessionId);\n loadDiagnostics.delete(`session:${sessionId}`);\n if (sessionState === undefined) return;\n for (const channel of sessionState.channels.values()) channel.drop(sessionId);\n sessionStates.delete(sessionId);\n sessionPlugins.delete(sessionId);\n sessionWorkspaces.delete(sessionId);\n if (sessionId === activeSessionId) emitRegistryChange();\n }\n\n function subscribeWebPluginRegistry(listener: () => void): () => void {\n registryListeners.add(listener);\n return () => registryListeners.delete(listener);\n }\n\n function webPluginRegistryRevision(): number {\n return registryRevision;\n }\n\n /**\n * Records the slots one mount could not load, replacing its previous record. The mount still\n * installs the slots that loaded, so one broken plugin never hides the others.\n */\n function setWebPluginLoadDiagnostics(mount: WebPluginMount, diagnostics: readonly InstallDiagnostic[]): void {\n const key =\n mount.scope === 'host'\n ? 'host'\n : mount.scope === 'workspace'\n ? `workspace:${mount.workspaceId}`\n : `session:${mount.sessionId}`;\n if (diagnostics.length === 0 && !loadDiagnostics.has(key)) return;\n if (diagnostics.length === 0) loadDiagnostics.delete(key);\n else loadDiagnostics.set(key, [...diagnostics]);\n emitRegistryChange();\n }\n\n /**\n * What the install had to resolve between plugins, plus the slots the visible mounts could not\n * load; empty for a composition whose plugins all load and never collide.\n */\n function webPluginDiagnostics(): readonly InstallDiagnostic[] {\n const workspaceId =\n (activeSessionId === null ? undefined : sessionWorkspaces.get(activeSessionId)) ?? activeWorkspaceId;\n const failed = [\n 'host',\n ...(workspaceId === null ? [] : [`workspace:${workspaceId}`]),\n ...(activeSessionId === null ? [] : [`session:${activeSessionId}`]),\n ].flatMap((key) => loadDiagnostics.get(key) ?? []);\n const installed = activeState().diagnostics;\n return failed.length === 0 ? installed : [...installed, ...failed];\n }\n\n /** Every installed plugin definition, in install order; the settings page lists them. */\n function installedWebPlugins(): readonly WebPluginDefinition[] {\n return activeState().plugins;\n }\n\n /** Package panels placed under the host's repository controls, in stable display order. */\n function pluginRepositorySettingsPanels(): readonly InstalledRepositorySettingsPanel[] {\n return (workspaceState() ?? emptyState()).plugins\n .flatMap((plugin) =>\n plugin.repositorySettingsPanel === undefined\n ? []\n : [{ pluginId: plugin.id, ...plugin.repositorySettingsPanel }],\n )\n .sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) ||\n left.pluginId.localeCompare(right.pluginId),\n );\n }\n\n function webTabs(sessionId?: string | null): readonly TabContribution[] {\n return activeState(sessionId).tabs;\n }\n\n /** Optional right-dock faces from the active session composition, in display order. */\n function pluginDockFaces(): readonly DockFaceContribution[] {\n return activeState().dockFaces;\n }\n\n /** UI discovery only. Requests still require a proof injected by Electron's main process. */\n function isDesktopClient(): boolean {\n return (\n typeof window !== 'undefined' &&\n (window as Window & { poDesktop?: { platform?: string } }).poDesktop?.platform === 'desktop'\n );\n }\n /**\n * The settings pages plugins contribute, in menu order. Sorted here rather than\n * at the reader so the menu and the page agree without either sorting twice.\n */\n function pluginSettingsSections(scope: 'host' | 'workspace' = 'host'): readonly SettingsSectionContribution[] {\n const sections = (scope === 'host' ? defaultState : workspaceState())?.settingsSections ?? [];\n const visible = isDesktopClient() ? sections : sections.filter((section) => !section.desktopOnly);\n if (!isSelfHostShell()) return visible;\n return visible.map((section) => {\n const fields = section.fields.filter((field) => !field.localOnly);\n return {\n ...section,\n fields,\n ...(section.groups === undefined\n ? {}\n : { groups: section.groups.filter((group) => fields.some((field) => field.group === group.id)) }),\n };\n });\n }\n\n /** The settings pages plugins draw themselves, in install order; the reader sorts them with the sections. */\n function pluginSettingsPanels(): readonly InstalledSettingsPanel[] {\n return defaultState.settingsPanels;\n }\n\n /** The fills placed into one slot, in slot order; empty for a slot nobody declared. */\n function slotFills(slot: string, sessionId?: string | null): readonly ResolvedFill[] {\n return activeState(sessionId).fills.get(slot) ?? [];\n }\n\n /** One workspace's own fills for a slot, whichever session or workspace is focused. */\n function workspaceSlotFills(workspaceId: string, slot: string): readonly ResolvedFill[] {\n return workspaceStates.get(workspaceId)?.fills.get(slot) ?? [];\n }\n\n /** The global plugins' fills for a slot, whichever session or workspace is focused. */\n function globalSlotFills(slot: string): readonly ResolvedFill[] {\n return defaultState.fills.get(slot) ?? [];\n }\n\n /** Dashboard reads never inherit the currently focused session. */\n function dashboardTileFills(mount: Exclude<WebPluginMount, { scope: 'session' }>): readonly InstalledDashboardTile[] {\n const surface = mount.scope === 'workspace' ? 'workspace' : 'home';\n const global = (defaultState.fills.get(HOST_SLOTS.dashboardTiles) ?? []).filter((fill) =>\n ((fill.data as DashboardTileData).surfaces ?? ['home']).includes(surface),\n );\n const workspace =\n mount.scope === 'workspace'\n ? (workspaceStates.get(mount.workspaceId)?.fills.get(HOST_SLOTS.dashboardTiles) ?? [])\n : [];\n const merged = new Map<string, ResolvedFill>();\n for (const fill of [...global, ...workspace]) merged.set(JSON.stringify([fill.pluginId, fill.id]), fill);\n return [...merged.values()].sort(byFillOrder) as InstalledDashboardTile[];\n }\n\n /** A dual-publishing plugin uses its new Home tiles, never both card versions. */\n function legacyHomeAppFills(): readonly ResolvedFill[] {\n const tiled = new Set(dashboardTileFills({ scope: 'host' }).map((fill) => fill.pluginId));\n return globalSlotFills(HOST_SLOTS.homeApps).filter((fill) => !tiled.has(fill.pluginId));\n }\n\n /** Home reads an explicit host mount, never the focused session or workspace. */\n function pluginHomeContributions(\n mount: Exclude<WebPluginMount, { scope: 'session' }>,\n ): readonly InstalledHomeContribution[] {\n const global = defaultState.fills.get(HOST_SLOTS.home) ?? [];\n const workspace =\n mount.scope === 'workspace' ? (workspaceStates.get(mount.workspaceId)?.fills.get(HOST_SLOTS.home) ?? []) : [];\n const seen = new Set<string>();\n const contributions: InstalledHomeContribution[] = [];\n for (const fill of [...global, ...workspace]) {\n const data = parseHomeContribution(fill.data);\n if (data === null) continue;\n const key = `${fill.pluginId}\\0${data.source}`;\n if (seen.has(key)) continue;\n seen.add(key);\n contributions.push({\n pluginId: fill.pluginId,\n id: fill.id,\n order: fill.order,\n data,\n mount: global.includes(fill) ? { scope: 'host' } : mount,\n });\n }\n return contributions.sort(\n (left, right) =>\n left.order - right.order || left.pluginId.localeCompare(right.pluginId) || left.id.localeCompare(right.id),\n );\n }\n\n function paletteCommands(): readonly PaletteCommandContribution[] {\n return activeState().commands;\n }\n\n /** Context actions from every installed plugin, in stable display order. */\n function pluginContextActions(sessionId?: string | null): readonly InstalledContextAction[] {\n return activeState(sessionId).contextActions;\n }\n\n /** User-message actions from every installed plugin, in stable display order. */\n function pluginUserMessageActions(): readonly InstalledUserMessageAction[] {\n return activeState().userMessageActions;\n }\n\n /** Leader Space bindings from every installed plugin, in install order: a later binding on a bound leaf wins. */\n function pluginLeaderBindings(): readonly LeaderBindingContribution[] {\n return activeState().leaderBindings;\n }\n\n /** Selection-axis declarations from every installed plugin, in display order. */\n function pluginSelectionAxes(): readonly SelectionAxisContribution[] {\n return activeState().selectionAxes;\n }\n\n /** Minor-mode declarations from every installed plugin, in display order. */\n function pluginMinorModes(): readonly MinorModeContribution[] {\n return activeState().minorModes;\n }\n\n /** Activity-dock group declarations from every installed plugin, in display order. */\n function pluginActivityGroups(sessionId?: string | null): readonly ActivityGroupContribution[] {\n const groups = activeState(sessionId).activityGroups;\n return isDesktopClient() ? groups : groups.filter((group) => !group.desktopOnly);\n }\n\n /**\n * The file-link sources installed plugins contribute, in install order.\n *\n * More than one is allowed and the first to claim a path wins, the same way a\n * runtime tool matcher does: the host has no way to choose between two\n * packages that both recognise a path, and the alternative is two tabs for one\n * file.\n */\n function pluginFileLinks(sessionId?: string | null): readonly FileLinkSource[] {\n return activeState(sessionId).fileLinks;\n }\n\n /**\n * The renderer a plugin registered for one tool: the exact name claim first,\n * then the first runtime matcher that accepts it, in install order (the one\n * place besides `start` where that order is observable); undefined leaves\n * the host's default card.\n */\n function pluginToolRenderer(\n toolName: string,\n statuses: Readonly<Record<string, string>> = {},\n details?: unknown,\n ): ToolRendererContribution | undefined {\n return resolveToolRenderer(activeState(), toolName, statuses, details);\n }\n\n function resolveToolRenderer(\n state: RegistryState,\n toolName: string,\n statuses: Readonly<Record<string, string>>,\n details: unknown,\n ): ToolRendererContribution | undefined {\n return (\n state.toolRenderers.get(toolName) ??\n state.toolMatchers.find((renderer) => {\n try {\n return renderer.matches?.(toolName, statuses, details);\n } catch {\n // A plugin's predicate must not take down tool cards, prompts or completion routing.\n return false;\n }\n })\n );\n }\n\n /**\n * A session-scoped renderer, resolved the way pluginToolRenderer resolves the\n * active one, or undefined until that session's verified composition is installed.\n */\n function sessionToolRenderer(\n sessionId: string,\n toolName: string,\n statuses: Readonly<Record<string, string>> = {},\n details?: unknown,\n ): ToolRendererContribution | undefined {\n const state = sessionStates.get(sessionId);\n return state === undefined ? undefined : resolveToolRenderer(state, toolName, statuses, details);\n }\n\n function sessionWebPluginsInstalled(sessionId: string): boolean {\n return sessionPlugins.has(sessionId);\n }\n\n /**\n * Routes one wire frame to the channel owning its type. Returns false when no\n * channel claims it, so the demux can fall through silently the way unknown\n * frames always have.\n */\n function dispatchFrameToState(state: RegistryState, frame: Record<string, unknown>): boolean {\n if (typeof frame.type !== 'string' || typeof frame.sessionId !== 'string') return false;\n const channel = state.channels.get(frame.type);\n if (channel === undefined) return false;\n const payload = channel.parse(frame.payload);\n if (payload !== null) channel.apply(frame.sessionId, payload);\n return true;\n }\n\n function dispatchChannelFrame(frame: Record<string, unknown>): boolean {\n if (typeof frame.type !== 'string' || typeof frame.sessionId !== 'string') return false;\n const state = sessionStates.get(frame.sessionId);\n if (state !== undefined) {\n if (dispatchFrameToState(state, frame)) return true;\n } else if (activeSessionId === null) return dispatchFrameToState(defaultState, frame);\n // Channel envelopes carry payload; protocol events do not and must not accumulate.\n if (!Object.hasOwn(frame, 'payload')) return false;\n const pending = pendingSessionFrames.get(frame.sessionId) ?? new Map<string, Record<string, unknown>>();\n if (!pending.has(frame.type) && pending.size >= MAX_PENDING_CHANNEL_TYPES) {\n const oldest = pending.keys().next().value as string | undefined;\n if (oldest !== undefined) pending.delete(oldest);\n }\n pending.set(frame.type, frame);\n pendingSessionFrames.set(frame.sessionId, pending);\n return false;\n }\n\n /** Session teardown: every channel forgets the session's data. */\n function dropPluginSessionData(sessionId: string): void {\n pendingSessionFrames.delete(sessionId);\n const state = sessionStates.get(sessionId) ?? (activeSessionId === null ? defaultState : undefined);\n for (const channel of state?.channels.values() ?? []) channel.drop(sessionId);\n }\n\n const mcpAppRenderers = new Map<string, NonNullable<WebPluginSlotProps['renderMcpApp']>>();\n\n function pluginMcpAppRenderer(sessionId: string | null) {\n return sessionId === null ? undefined : mcpAppRenderers.get(sessionId);\n }\n\n /**\n * Starts every plugin runtime in install order; the disposer runs in reverse. With `onFailure`\n * a plugin whose start throws is reported and skipped, so the others still start.\n */\n function startPluginDefinitions(\n plugins: readonly WebPluginDefinition[],\n runtime: WebPluginRuntime,\n onFailure?: (pluginId: string, error: unknown) => void,\n ): () => void {\n const disposers: Array<() => void> = [];\n const disposeStarted = (): void => {\n for (const dispose of disposers.reverse()) dispose();\n };\n for (const plugin of plugins) {\n try {\n const sessionId = runtime.mount?.scope === 'session' ? runtime.mount.sessionId : undefined;\n const dispose = plugin.start?.({\n ...runtime,\n ...(sessionId === undefined\n ? {}\n : {\n registerMcpAppRenderer(render) {\n mcpAppRenderers.set(sessionId, render);\n const unregister = () => {\n if (mcpAppRenderers.get(sessionId) === render) mcpAppRenderers.delete(sessionId);\n };\n disposers.push(unregister);\n return unregister;\n },\n }),\n });\n if (dispose) disposers.push(dispose);\n } catch (error) {\n if (onFailure) {\n onFailure(plugin.id, error);\n continue;\n }\n disposeStarted();\n throw error;\n }\n }\n return disposeStarted;\n }\n\n function startWebPlugins(runtime: WebPluginRuntime): () => void {\n return startPluginDefinitions(activeState().plugins, runtime);\n }\n\n const owner = <T extends { pluginId: string }>(entry: T): T =>\n hostId === undefined ? entry : { ...entry, pluginId: qualifyHostId(hostId, entry.pluginId) };\n return {\n globalPluginProviders: (): readonly InstalledGlobalPluginProvider[] => providers,\n pluginThemes: (): readonly InstalledPluginTheme[] => themes,\n webTemplateCatalog,\n nativeTemplateCatalog,\n installGlobalWebPlugins,\n installWorkspaceWebPlugins,\n removeWorkspaceWebPlugins,\n activateWebPluginWorkspace,\n bindSessionWebWorkspace,\n installWebPlugins,\n webPluginsInstalled,\n resetWebPlugins,\n installSessionWebPlugins,\n activateWebPluginSession,\n removeSessionWebPlugins,\n subscribeWebPluginRegistry,\n webPluginRegistryRevision,\n setWebPluginLoadDiagnostics,\n webPluginDiagnostics: (...args: Parameters<typeof webPluginDiagnostics>) =>\n webPluginDiagnostics(...args).map(owner),\n installedWebPlugins: () =>\n installedWebPlugins().map((plugin) =>\n hostId === undefined ? plugin : { ...plugin, id: qualifyHostId(hostId, plugin.id) },\n ),\n pluginRepositorySettingsPanels: (...args: Parameters<typeof pluginRepositorySettingsPanels>) =>\n pluginRepositorySettingsPanels(...args).map(owner),\n webTabs,\n pluginDockFaces,\n isDesktopClient,\n pluginSettingsSections,\n pluginSettingsPanels: (...args: Parameters<typeof pluginSettingsPanels>) =>\n pluginSettingsPanels(...args).map(owner),\n slotFills: (...args: Parameters<typeof slotFills>) => slotFills(...args).map(owner),\n workspaceSlotFills: (...args: Parameters<typeof workspaceSlotFills>) => workspaceSlotFills(...args).map(owner),\n globalSlotFills: (...args: Parameters<typeof globalSlotFills>) => globalSlotFills(...args).map(owner),\n dashboardTileFills: (...args: Parameters<typeof dashboardTileFills>) => dashboardTileFills(...args).map(owner),\n legacyHomeAppFills: () => legacyHomeAppFills().map(owner),\n pluginHomeContributions: (...args: Parameters<typeof pluginHomeContributions>) =>\n pluginHomeContributions(...args).map(owner),\n paletteCommands,\n pluginContextActions: (...args: Parameters<typeof pluginContextActions>) =>\n pluginContextActions(...args).map(owner),\n pluginUserMessageActions: (...args: Parameters<typeof pluginUserMessageActions>) =>\n pluginUserMessageActions(...args).map(owner),\n pluginLeaderBindings,\n pluginSelectionAxes,\n pluginMinorModes,\n pluginActivityGroups,\n pluginFileLinks,\n pluginToolRenderer,\n pluginMcpAppRenderer,\n sessionToolRenderer,\n sessionWebPluginsInstalled,\n dispatchChannelFrame,\n dropPluginSessionData,\n startPluginDefinitions,\n startWebPlugins,\n };\n}\n\nexport type WebPluginRegistry = ReturnType<typeof createWebPluginRegistry>;\nconst defaultRegistry = createWebPluginRegistry();\nconst hostRegistries = new Map<string, WebPluginRegistry>();\nlet activeHostId: string | undefined;\nexport function webPluginRegistryForHost(hostId: string): WebPluginRegistry {\n let registry = hostRegistries.get(hostId);\n if (!registry) {\n registry = observeRegistry(createWebPluginRegistry(hostId));\n hostRegistries.set(hostId, registry);\n }\n return registry;\n}\nexport function removeHostWebPlugins(hostId: string): void {\n hostRegistries.get(hostId)?.resetWebPlugins();\n hostRegistries.delete(hostId);\n if (activeHostId === hostId) activeHostId = undefined;\n}\n\nconst registrySubscribers = new Set<() => void>();\nfunction notifyRegistrySubscribers(): void {\n noteStoreUpdate('pluginRegistry', combinedRevision, combinedRevision + 1);\n for (const listener of registrySubscribers) listener();\n}\nlet combinedRevision = 0;\nconst observedRegistries = new WeakSet<WebPluginRegistry>();\nfunction observeRegistry(registry: WebPluginRegistry): WebPluginRegistry {\n if (!observedRegistries.has(registry)) {\n observedRegistries.add(registry);\n registry.subscribeWebPluginRegistry(() => {\n combinedRevision += 1;\n notifyRegistrySubscribers();\n });\n }\n return registry;\n}\n/** Selects host-owned global surfaces when no session or workspace is focused. */\nexport function activateWebPluginHost(hostId: string | undefined): void {\n if (activeHostId === hostId) return;\n activeHostId = hostId;\n combinedRevision += 1;\n notifyRegistrySubscribers();\n}\n\nfunction selectedRegistry(): WebPluginRegistry {\n return activeHostId === undefined ? defaultRegistry : webPluginRegistryForHost(activeHostId);\n}\nfunction registryForKey(key: string): WebPluginRegistry {\n const qualified = splitHostId(key);\n return observeRegistry(qualified === undefined ? defaultRegistry : webPluginRegistryForHost(qualified.hostId));\n}\nfunction registryForMount(mount?: WebPluginMount): WebPluginRegistry {\n return mount === undefined || mount.scope === 'host'\n ? selectedRegistry()\n : registryForKey(mount.scope === 'session' ? mount.sessionId : mount.workspaceId);\n}\n\nexport const webTemplateCatalog: WebPluginRegistry['webTemplateCatalog'] = (...args) =>\n registryForMount(args[0]).webTemplateCatalog(...args);\n\nexport const nativeTemplateCatalog: WebPluginRegistry['nativeTemplateCatalog'] = (...args) =>\n registryForMount(args[0]).nativeTemplateCatalog(...args);\n\nexport const installGlobalWebPlugins: WebPluginRegistry['installGlobalWebPlugins'] = (...args) =>\n selectedRegistry().installGlobalWebPlugins(...args);\n\nexport const installWorkspaceWebPlugins: WebPluginRegistry['installWorkspaceWebPlugins'] = (...args) =>\n registryForKey(args[0]).installWorkspaceWebPlugins(...args);\n\nexport const removeWorkspaceWebPlugins: WebPluginRegistry['removeWorkspaceWebPlugins'] = (...args) =>\n registryForKey(args[0]).removeWorkspaceWebPlugins(...args);\n\nexport const bindSessionWebWorkspace: WebPluginRegistry['bindSessionWebWorkspace'] = (...args) =>\n registryForKey(args[0]).bindSessionWebWorkspace(...args);\n\nexport const installWebPlugins: WebPluginRegistry['installWebPlugins'] = (...args) =>\n selectedRegistry().installWebPlugins(...args);\n\nexport const webPluginsInstalled: WebPluginRegistry['webPluginsInstalled'] = (...args) =>\n selectedRegistry().webPluginsInstalled(...args);\n\nexport const installSessionWebPlugins: WebPluginRegistry['installSessionWebPlugins'] = (...args) =>\n registryForKey(args[0]).installSessionWebPlugins(...args);\n\nexport const removeSessionWebPlugins: WebPluginRegistry['removeSessionWebPlugins'] = (...args) =>\n registryForKey(args[0]).removeSessionWebPlugins(...args);\n\nexport const setWebPluginLoadDiagnostics: WebPluginRegistry['setWebPluginLoadDiagnostics'] = (...args) =>\n registryForMount(args[0]).setWebPluginLoadDiagnostics(...args);\n\nexport const webPluginDiagnostics: WebPluginRegistry['webPluginDiagnostics'] = (...args) =>\n selectedRegistry().webPluginDiagnostics(...args);\n\nexport const installedWebPlugins: WebPluginRegistry['installedWebPlugins'] = (...args) =>\n selectedRegistry().installedWebPlugins(...args);\n\nexport const pluginRepositorySettingsPanels: WebPluginRegistry['pluginRepositorySettingsPanels'] = (...args) =>\n selectedRegistry().pluginRepositorySettingsPanels(...args);\n\nexport const webTabs: WebPluginRegistry['webTabs'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).webTabs(...args);\n\nexport const pluginDockFaces: WebPluginRegistry['pluginDockFaces'] = (...args) =>\n selectedRegistry().pluginDockFaces(...args);\n\nexport const isDesktopClient: WebPluginRegistry['isDesktopClient'] = (...args) =>\n selectedRegistry().isDesktopClient(...args);\n\nexport const pluginSettingsSections: WebPluginRegistry['pluginSettingsSections'] = (...args) =>\n selectedRegistry().pluginSettingsSections(...args);\n\nexport const pluginSettingsPanels: WebPluginRegistry['pluginSettingsPanels'] = (...args) =>\n selectedRegistry().pluginSettingsPanels(...args);\n\nexport const slotFills: WebPluginRegistry['slotFills'] = (...args) =>\n (typeof args[1] === 'string' ? registryForKey(args[1]) : selectedRegistry()).slotFills(...args);\n\nexport const workspaceSlotFills: WebPluginRegistry['workspaceSlotFills'] = (...args) =>\n registryForKey(args[0]).workspaceSlotFills(...args);\n\n/** The themes this browser's own global plugins contribute; a remote host's themes are not the person's. */\nexport function pluginThemes(): readonly InstalledPluginTheme[] {\n return defaultRegistry.pluginThemes();\n}\n\n/**\n * The themes the person's paired computers contribute, for the phone, which pairs only with their\n * own computers. One plugin on two computers is offered once, under its first computer's colours.\n */\nexport function allPluginThemes(): readonly InstalledPluginTheme[] {\n const seen = new Set<string>();\n return [defaultRegistry, ...hostRegistries.values()]\n .flatMap((registry) => registry.pluginThemes())\n .filter(({ theme }) => {\n if (seen.has(theme.name)) return false;\n seen.add(theme.name);\n return true;\n });\n}\n\n/** All host-global providers, default first then host registry creation order, independent of focus. */\nexport function globalPluginProviders(): readonly InstalledGlobalPluginProvider[] {\n return [defaultRegistry, ...hostRegistries.values()].flatMap((registry) => registry.globalPluginProviders());\n}\n\nexport const globalSlotFills: WebPluginRegistry['globalSlotFills'] = (...args) =>\n selectedRegistry().globalSlotFills(...args);\n\nexport const dashboardTileFills: WebPluginRegistry['dashboardTileFills'] = (...args) =>\n registryForMount(args[0]).dashboardTileFills(...args);\n\nexport const legacyHomeAppFills: WebPluginRegistry['legacyHomeAppFills'] = () =>\n selectedRegistry().legacyHomeAppFills();\n\nexport const pluginHomeContributions: WebPluginRegistry['pluginHomeContributions'] = (...args) =>\n registryForMount(args[0]).pluginHomeContributions(...args);\n\nexport const paletteCommands: WebPluginRegistry['paletteCommands'] = (...args) =>\n selectedRegistry().paletteCommands(...args);\n\nexport const pluginContextActions: WebPluginRegistry['pluginContextActions'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginContextActions(...args);\n\nexport const pluginUserMessageActions: WebPluginRegistry['pluginUserMessageActions'] = (...args) =>\n selectedRegistry().pluginUserMessageActions(...args);\n\nexport const pluginLeaderBindings: WebPluginRegistry['pluginLeaderBindings'] = (...args) =>\n selectedRegistry().pluginLeaderBindings(...args);\n\nexport const pluginSelectionAxes: WebPluginRegistry['pluginSelectionAxes'] = (...args) =>\n selectedRegistry().pluginSelectionAxes(...args);\n\nexport const pluginMinorModes: WebPluginRegistry['pluginMinorModes'] = (...args) =>\n selectedRegistry().pluginMinorModes(...args);\n\nexport const pluginActivityGroups: WebPluginRegistry['pluginActivityGroups'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginActivityGroups(...args);\n\nexport const pluginFileLinks: WebPluginRegistry['pluginFileLinks'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginFileLinks(...args);\n\nexport const pluginToolRenderer: WebPluginRegistry['pluginToolRenderer'] = (...args) =>\n selectedRegistry().pluginToolRenderer(...args);\n\nexport const sessionToolRenderer: WebPluginRegistry['sessionToolRenderer'] = (...args) =>\n registryForKey(args[0]).sessionToolRenderer(...args);\n\nexport const sessionWebPluginsInstalled: WebPluginRegistry['sessionWebPluginsInstalled'] = (...args) =>\n registryForKey(args[0]).sessionWebPluginsInstalled(...args);\n\nexport const dispatchChannelFrame: WebPluginRegistry['dispatchChannelFrame'] = (...args) =>\n (typeof args[0].sessionId === 'string' ? registryForKey(args[0].sessionId) : selectedRegistry()).dispatchChannelFrame(\n ...args,\n );\n\nexport const dropPluginSessionData: WebPluginRegistry['dropPluginSessionData'] = (...args) =>\n registryForKey(args[0]).dropPluginSessionData(...args);\n\nexport const startPluginDefinitions: WebPluginRegistry['startPluginDefinitions'] = (...args) =>\n selectedRegistry().startPluginDefinitions(...args);\n\nexport const startWebPlugins: WebPluginRegistry['startWebPlugins'] = (...args) =>\n selectedRegistry().startWebPlugins(...args);\n\nexport function subscribeWebPluginRegistry(listener: () => void): () => void {\n observeRegistry(defaultRegistry);\n registrySubscribers.add(listener);\n return () => registrySubscribers.delete(listener);\n}\nexport function webPluginRegistryRevision(): number {\n return combinedRevision;\n}\nexport function activateWebPluginSession(sessionId: string | null): void {\n const nextHost = sessionId === null ? activeHostId : splitHostId(sessionId)?.hostId;\n const changed = activeHostId !== nextHost;\n activeHostId = nextHost;\n observeRegistry(selectedRegistry()).activateWebPluginSession(sessionId);\n if (changed) {\n combinedRevision += 1;\n notifyRegistrySubscribers();\n }\n}\nexport function activateWebPluginWorkspace(workspaceId: string | null): void {\n const nextHost = workspaceId === null ? activeHostId : splitHostId(workspaceId)?.hostId;\n const changed = activeHostId !== nextHost;\n activeHostId = nextHost;\n observeRegistry(selectedRegistry()).activateWebPluginWorkspace(workspaceId);\n if (changed) {\n combinedRevision += 1;\n notifyRegistrySubscribers();\n }\n}\nexport function resetWebPlugins(): void {\n for (const registry of hostRegistries.values()) registry.resetWebPlugins();\n hostRegistries.clear();\n activeHostId = undefined;\n observeRegistry(defaultRegistry).resetWebPlugins();\n}\n\nexport const pluginMcpAppRenderer: WebPluginRegistry['pluginMcpAppRenderer'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginMcpAppRenderer(...args);\n"],"mappings":";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d,2BAA2B;wBAK3B;wBAGA,yBAAyB;wBAUzB,2BAA2B;wBAU3B;qBAOH,sBAAsB"}
@@ -21,6 +21,7 @@ function parseDashboardTileData(input) {
21
21
  if (data.column !== void 0 && data.column !== "main" && data.column !== "side") return null;
22
22
  if (data.icon !== void 0 && typeof data.icon !== "function" && (typeof data.icon !== "object" || data.icon === null)) return null;
23
23
  if (data.combinesComputers !== void 0 && typeof data.combinesComputers !== "boolean") return null;
24
+ if (data.dataScope !== void 0 && data.dataScope !== "host" && data.dataScope !== "global") return null;
24
25
  if (data.surfaces !== void 0 && (!Array.isArray(data.surfaces) || data.surfaces.some((surface) => surface !== "home" && surface !== "workspace"))) return null;
25
26
  if (data.open !== void 0) {
26
27
  if (typeof data.open !== "object" || data.open === null || Array.isArray(data.open)) return null;
@@ -1 +1 @@
1
- {"version":3,"file":"pluginRegistry.mjs","names":[],"sources":["../../../src/web/lib/pluginRegistry.ts"],"sourcesContent":["import type {\n ActivityGroupContribution,\n ContextActionContribution,\n DashboardTileData,\n DockFaceContribution,\n FileLinkSource,\n LeaderBindingContribution,\n MinorModeContribution,\n PaletteCommandContribution,\n RepositorySettingsPanelContribution,\n SettingsPanelContribution,\n SettingsSectionContribution,\n SelectionAxisContribution,\n SessionChannelContribution,\n SlotDeclaration,\n SlotFillContribution,\n SurfaceContribution,\n TabContribution,\n ToolRendererContribution,\n UserMessageActionContribution,\n WebPluginDefinition,\n WebPluginMount,\n WebPluginRuntime,\n WebPluginSlotProps,\n} from '@agimon-ai/po-core/web';\nimport { activityGroupSlot, HOST_SLOTS, parseHomeContribution, type HomeContribution } from '@agimon-ai/po-core/web';\nexport { activityGroupSlot, HOST_SLOTS } from '@agimon-ai/po-core/web';\nimport type { ComponentType, ReactNode } from 'react';\n\nimport { qualifyHostId, splitHostId } from './hostIdentity';\nimport { leaderConflicts } from './leaderTree';\nimport { mergeScopedPlugins, pluginsAtScope } from './pluginScopes';\nimport { collectPluginThemes, type InstalledPluginTheme } from './pluginThemes';\nimport { isSelfHostShell } from './selfHostShell';\nimport {\n collectNativeTemplates,\n collectWebTemplates,\n type NativeTemplateCatalog,\n type WebTemplateCatalog,\n} from './templateCatalog';\nimport { noteStoreUpdate } from './uiTrace';\n\n/**\n * The installed plugin set.\n *\n * Plain module state rather than a reactive store: the generated plugin list\n * is installed once at startup, before the first render, so every read during\n * render is stable. Install runs in two phases. The first collects every\n * plugin's contributions in the generated order, which is (registrationOrder,\n * pluginId); the second resolves every relation between plugins by name, so\n * a plugin may fill a slot whichever of the two installs first.\n *\n * Plugins are independent and a user may install any of them, so a collision\n * between two plugins never fails the install: a shared name goes to the\n * first plugin (a Leader Space leaf to the later one, as the TUI documents)\n * and the loser is recorded as a diagnostic. Only a malformed contribution\n * inside one plugin throws, because that is a developer error its own tests\n * catch. resetWebPlugins exists for unit tests only.\n */\n\nexport type InstallDiagnosticKind =\n | 'duplicate-plugin'\n | 'duplicate-tab'\n | 'duplicate-dock-face'\n | 'duplicate-channel'\n | 'duplicate-tool'\n | 'duplicate-activity-group'\n | 'duplicate-minor-mode'\n | 'duplicate-selection-axis'\n | 'duplicate-palette-command'\n | 'duplicate-settings-section'\n | 'leader-leaf-override'\n | 'leader-group-label'\n | 'orphan-fill'\n | 'rejected-fill'\n | 'rejected-theme'\n | 'duplicate-theme'\n | 'invalid-template'\n | 'duplicate-template'\n | 'slot-load-failed'\n | 'start-failed'\n | 'invalid-plugin';\n\nexport interface InstallDiagnostic {\n /** The plugin that lost or misfiled the contribution. */\n pluginId: string;\n kind: InstallDiagnosticKind;\n message: string;\n}\n\n/** One placed fill, as the owner's renderSlot and slotData read it. */\nexport interface ResolvedFill {\n slot: string;\n pluginId: string;\n id: string;\n order: number;\n data?: unknown;\n component?: ComponentType<WebPluginSlotProps>;\n}\n\nexport interface InstalledDashboardTile extends ResolvedFill {\n data: DashboardTileData;\n}\n\n/** Reject malformed tile presentation without executing its body. */\nexport function parseDashboardTileData(input: unknown): DashboardTileData | null {\n if (typeof input !== 'object' || input === null || Array.isArray(input)) return null;\n const data = input as Record<string, unknown>;\n if (data.version !== 1 || typeof data.title !== 'string' || data.title.trim() === '') return null;\n if (data.size !== undefined && !['small', 'wide', 'tall', 'large'].includes(data.size as string)) return null;\n if (data.column !== undefined && data.column !== 'main' && data.column !== 'side') return null;\n if (\n data.icon !== undefined &&\n typeof data.icon !== 'function' &&\n (typeof data.icon !== 'object' || data.icon === null)\n )\n return null;\n if (data.combinesComputers !== undefined && typeof data.combinesComputers !== 'boolean') return null;\n if (\n data.surfaces !== undefined &&\n (!Array.isArray(data.surfaces) || data.surfaces.some((surface) => surface !== 'home' && surface !== 'workspace'))\n )\n return null;\n if (data.open !== undefined) {\n if (typeof data.open !== 'object' || data.open === null || Array.isArray(data.open)) return null;\n const open = data.open as Record<string, unknown>;\n if ((open.kind !== 'page' && open.kind !== 'settings') || typeof open.id !== 'string' || open.id.trim() === '')\n return null;\n }\n return input as DashboardTileData;\n}\n\nexport interface InstalledContextAction extends ContextActionContribution {\n pluginId: string;\n}\n\nexport interface InstalledUserMessageAction extends UserMessageActionContribution {\n pluginId: string;\n}\n\nconst SLOT_SEPARATOR = '.';\nconst DEFAULT_FILL_ORDER = 1000;\nconst RESERVED_PLUGIN_IDS: ReadonlySet<string> = new Set(Object.values(HOST_SLOTS));\n\ninterface RegistryState {\n plugins: WebPluginDefinition[];\n tabs: TabContribution[];\n dockFaces: DockFaceContribution[];\n channels: Map<string, SessionChannelContribution>;\n commands: PaletteCommandContribution[];\n contextActions: InstalledContextAction[];\n userMessageActions: InstalledUserMessageAction[];\n leaderBindings: LeaderBindingContribution[];\n selectionAxes: SelectionAxisContribution[];\n minorModes: MinorModeContribution[];\n activityGroups: ActivityGroupContribution[];\n settingsSections: SettingsSectionContribution[];\n settingsPanels: InstalledSettingsPanel[];\n toolRenderers: Map<string, ToolRendererContribution>;\n toolMatchers: ToolRendererContribution[];\n slots: Map<string, SlotDeclaration>;\n fills: Map<string, ResolvedFill[]>;\n fileLinks: FileLinkSource[];\n diagnostics: InstallDiagnostic[];\n}\n\nfunction emptyState(): RegistryState {\n return {\n plugins: [],\n tabs: [],\n dockFaces: [],\n channels: new Map(),\n commands: [],\n contextActions: [],\n userMessageActions: [],\n leaderBindings: [],\n selectionAxes: [],\n minorModes: [],\n activityGroups: [],\n settingsSections: [],\n settingsPanels: [],\n toolRenderers: new Map(),\n toolMatchers: [],\n slots: new Map(),\n fills: new Map(),\n fileLinks: [],\n diagnostics: [],\n };\n}\n\nexport interface InstalledRepositorySettingsPanel extends RepositorySettingsPanelContribution {\n pluginId: string;\n}\nexport interface InstalledSettingsPanel extends SettingsPanelContribution {\n pluginId: string;\n}\nexport interface InstalledGlobalPluginProvider {\n pluginId: string;\n provider: ComponentType<{ children?: ReactNode }>;\n}\n\nexport interface InstalledHomeContribution {\n pluginId: string;\n id: string;\n order: number;\n data: HomeContribution;\n mount: Exclude<WebPluginMount, { scope: 'session' }>;\n}\n\n/** An independently owned host plugin registry. */\nexport function createWebPluginRegistry(hostId?: string) {\n let defaultState = emptyState();\n let installingState = defaultState;\n let defaultInstalled = false;\n let providers: readonly InstalledGlobalPluginProvider[] = [];\n let themes: readonly InstalledPluginTheme[] = [];\n const sessionStates = new Map<string, RegistryState>();\n const workspaceStates = new Map<string, RegistryState>();\n const sessionPlugins = new Map<string, readonly WebPluginDefinition[]>();\n const sessionWorkspaces = new Map<string, string>();\n let activeWorkspaceId: string | null = null;\n const pendingSessionFrames = new Map<string, Map<string, Record<string, unknown>>>();\n const MAX_PENDING_CHANNEL_TYPES = 64;\n let activeSessionId: string | null = null;\n /** Slots each mount could not load, keyed `global`, `workspace:<id>` or `session:<id>`. */\n const loadDiagnostics = new Map<string, readonly InstallDiagnostic[]>();\n let registryRevision = 0;\n const registryListeners = new Set<() => void>();\n\n function activeState(sessionId?: string | null): RegistryState {\n if (sessionId !== undefined && sessionId !== null) {\n const workspaceId = sessionWorkspaces.get(sessionId);\n return (\n sessionStates.get(sessionId) ??\n (workspaceId === undefined ? undefined : workspaceStates.get(workspaceId)) ??\n defaultState\n );\n }\n return (\n (activeSessionId === null ? undefined : sessionStates.get(activeSessionId)) ?? workspaceState() ?? defaultState\n );\n }\n\n function workspaceState(): RegistryState | undefined {\n return activeWorkspaceId === null ? undefined : workspaceStates.get(activeWorkspaceId);\n }\n\n /** Settings requests an explicit scope; the cockpit reads its active session composition. */\n function webTemplateCatalog(mount?: WebPluginMount): WebTemplateCatalog {\n if (mount === undefined) {\n const scope = activeSessionId === null ? (activeWorkspaceId === null ? 'host' : 'workspace') : 'session';\n return collectWebTemplates(activeState().plugins, scope);\n }\n if (mount.scope === 'host') return collectWebTemplates(defaultState.plugins, 'host');\n const workspace = workspaceStates.get(mount.workspaceId);\n const plugins = mount.scope === 'session' ? sessionStates.get(mount.sessionId)?.plugins : undefined;\n return collectWebTemplates(\n plugins ?? mergeScopedPlugins(defaultState.plugins, workspace?.plugins ?? []),\n mount.scope,\n );\n }\n\n /** The phone app's layouts at the server-resolved `native.template` mount. */\n function nativeTemplateCatalog(mount: WebPluginMount): NativeTemplateCatalog {\n if (mount.scope === 'host') return collectNativeTemplates(defaultState.plugins, 'host');\n const workspace = workspaceStates.get(mount.workspaceId);\n const plugins = mount.scope === 'session' ? sessionStates.get(mount.sessionId)?.plugins : undefined;\n return collectNativeTemplates(\n plugins ?? mergeScopedPlugins(defaultState.plugins, workspace?.plugins ?? []),\n mount.scope,\n );\n }\n function rebuildSession(sessionId: string): RegistryState {\n const previous = sessionStates.get(sessionId);\n const workspaceId = sessionWorkspaces.get(sessionId);\n const workspace = workspaceId === undefined ? undefined : workspaceStates.get(workspaceId);\n const state = buildLiveState(\n mergeScopedPlugins(defaultState.plugins, workspace?.plugins ?? [], sessionPlugins.get(sessionId) ?? []),\n );\n sessionStates.set(sessionId, state);\n // Drop stale stores before replay, since replacement channels may share a store.\n for (const [type, channel] of previous?.channels.entries() ?? [])\n if (state.channels.get(type) !== channel) channel.drop(sessionId);\n const pending = pendingSessionFrames.get(sessionId);\n if (pending !== undefined) {\n for (const [type, frame] of pending) if (dispatchFrameToState(state, frame)) pending.delete(type);\n if (pending.size === 0) pendingSessionFrames.delete(sessionId);\n }\n return state;\n }\n\n /** Themes are the person's, so only the global plugins contribute them. */\n function installThemes(plugins: readonly WebPluginDefinition[]): void {\n const collected = collectPluginThemes(plugins);\n themes = collected.themes;\n defaultState.diagnostics.push(...collected.diagnostics);\n }\n\n function installGlobalWebPlugins(plugins: readonly WebPluginDefinition[]): void {\n defaultState = buildLiveState(pluginsAtScope(plugins, 'host'), plugins);\n providers = defaultState.plugins.flatMap((plugin) => {\n const provider = plugins.find((definition) => definition.id === plugin.id)?.host?.provider;\n return provider === undefined\n ? []\n : [{ pluginId: hostId === undefined ? plugin.id : qualifyHostId(hostId, plugin.id), provider }];\n });\n installThemes(plugins);\n for (const id of sessionStates.keys()) rebuildSession(id);\n emitRegistryChange();\n }\n\n function installWorkspaceWebPlugins(workspaceId: string, plugins: readonly WebPluginDefinition[]): void {\n const state = buildLiveState(pluginsAtScope(plugins, 'workspace'), plugins);\n workspaceStates.set(workspaceId, state);\n for (const [id, owner] of sessionWorkspaces) if (owner === workspaceId) rebuildSession(id);\n emitRegistryChange();\n }\n\n function removeWorkspaceWebPlugins(workspaceId: string): void {\n workspaceStates.delete(workspaceId);\n loadDiagnostics.delete(`workspace:${workspaceId}`);\n for (const [id, owner] of sessionWorkspaces) if (owner === workspaceId) rebuildSession(id);\n if (activeWorkspaceId === workspaceId) activeWorkspaceId = null;\n emitRegistryChange();\n }\n\n function activateWebPluginWorkspace(workspaceId: string | null): void {\n if (activeWorkspaceId === workspaceId) return;\n activeWorkspaceId = workspaceId;\n emitRegistryChange();\n }\n\n function bindSessionWebWorkspace(sessionId: string, workspaceId: string): void {\n sessionWorkspaces.set(sessionId, workspaceId);\n rebuildSession(sessionId);\n }\n\n function emitRegistryChange(): void {\n registryRevision += 1;\n for (const listener of registryListeners) listener();\n }\n\n /** The TUI's leader alphabet: one lowercase letter or digit per segment. */\n const LEADER_KEY = /^[a-z0-9]$/;\n const MAX_LEADER_PATH = 4;\n\n /**\n * A malformed binding fails the install rather than the keypress: the plugin\n * set is generated at build time, so this is a developer error, and the TUI's\n * registry refuses the same shapes.\n */\n function checkLeaderBinding(pluginId: string, binding: LeaderBindingContribution): void {\n if (binding.path.length === 0 || binding.path.length > MAX_LEADER_PATH) {\n throw new Error(\n `Web plugin '${pluginId}' leader binding '${binding.id}' needs 1 to ${MAX_LEADER_PATH} path segments.`,\n );\n }\n for (const segment of binding.path) {\n if (!LEADER_KEY.test(segment.key)) {\n throw new Error(\n `Web plugin '${pluginId}' leader binding '${binding.id}' key '${segment.key}' must be one lowercase letter or digit.`,\n );\n }\n if (segment.label.trim() === '') {\n throw new Error(`Web plugin '${pluginId}' leader binding '${binding.id}' has an unlabeled segment.`);\n }\n }\n }\n\n interface PendingFill {\n pluginId: string;\n fill: SlotFillContribution;\n }\n\n interface PendingSection {\n pluginId: string;\n section: SurfaceContribution;\n }\n\n interface PendingBinding {\n pluginId: string;\n binding: LeaderBindingContribution;\n }\n\n type SharedNamespace =\n | 'plugin'\n | 'tab'\n | 'dock-face'\n | 'channel'\n | 'tool'\n | 'activity-group'\n | 'minor-mode'\n | 'selection-axis'\n | 'palette-command'\n | 'settings-section';\n\n /**\n * Claims `id` in one shared namespace: false, with a diagnostic, when another\n * plugin already holds it; a throw when this plugin declared it twice, which\n * is a developer error rather than a composition.\n */\n function claim(owners: Map<string, string>, thing: SharedNamespace, id: string, pluginId: string): boolean {\n const holder = owners.get(id);\n if (holder === pluginId) {\n throw new Error(`Web plugin '${pluginId}' declares ${thing.replace('-', ' ')} '${id}' twice.`);\n }\n if (holder !== undefined) {\n installingState.diagnostics.push({\n pluginId,\n kind: `duplicate-${thing}`,\n message: `Web plugin '${pluginId}' ${thing.replace('-', ' ')} '${id}' is already provided by '${holder}'; keeping the first.`,\n });\n return false;\n }\n owners.set(id, pluginId);\n return true;\n }\n\n function surfaceFill(slot: string, surface: SurfaceContribution): SlotFillContribution {\n return { slot, id: surface.id, component: surface.component };\n }\n\n function checkSlotDeclaration(pluginId: string, declared: Set<string>, declaration: SlotDeclaration): void {\n const prefix = `${pluginId}${SLOT_SEPARATOR}`;\n if (!declaration.slot.startsWith(prefix) || declaration.slot.length === prefix.length) {\n throw new Error(\n `Web plugin '${pluginId}' declares slot '${declaration.slot}', which must be named '${prefix}<name>'.`,\n );\n }\n if (declared.has(declaration.slot)) {\n throw new Error(`Web plugin '${pluginId}' declares slot '${declaration.slot}' twice.`);\n }\n declared.add(declaration.slot);\n }\n\n function checkFill(pluginId: string, seen: Set<string>, fill: SlotFillContribution): void {\n if (fill.id === '') throw new Error(`Web plugin '${pluginId}' has a fill into '${fill.slot}' with an empty id.`);\n if (fill.component === undefined && fill.data === undefined) {\n throw new Error(\n `Web plugin '${pluginId}' fill '${fill.id}' into '${fill.slot}' has neither a component nor data.`,\n );\n }\n const key = `${fill.slot} ${fill.id}`;\n if (seen.has(key)) throw new Error(`Web plugin '${pluginId}' fills '${fill.slot}' with id '${fill.id}' twice.`);\n seen.add(key);\n }\n\n function checkContextAction(pluginId: string, seen: Set<string>, action: ContextActionContribution): void {\n if (action.id.trim() === '') throw new Error(`Web plugin '${pluginId}' has a context action with an empty id.`);\n if (seen.has(action.id)) throw new Error(`Web plugin '${pluginId}' declares context action '${action.id}' twice.`);\n if (action.label.trim() === '')\n throw new Error(`Web plugin '${pluginId}' context action '${action.id}' has an empty label.`);\n if (action.kinds.length === 0 || action.kinds.some((kind) => kind.trim() === '')) {\n throw new Error(`Web plugin '${pluginId}' context action '${action.id}' needs non-empty kinds.`);\n }\n seen.add(action.id);\n }\n\n function checkUserMessageAction(pluginId: string, seen: Set<string>, action: UserMessageActionContribution): void {\n if (action.id.trim() === '')\n throw new Error(`Web plugin '${pluginId}' has a user message action with an empty id.`);\n if (seen.has(action.id))\n throw new Error(`Web plugin '${pluginId}' declares user message action '${action.id}' twice.`);\n if (action.label.trim() === '')\n throw new Error(`Web plugin '${pluginId}' user message action '${action.id}' has an empty label.`);\n seen.add(action.id);\n }\n\n const byFillOrder = (left: ResolvedFill, right: ResolvedFill): number =>\n left.order - right.order || left.pluginId.localeCompare(right.pluginId) || left.id.localeCompare(right.id);\n\n const byDisplayOrder = (left: { order?: number; name: string }, right: { order?: number; name: string }): number =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) || left.name.localeCompare(right.name);\n\n function placeFill(pluginId: string, fill: SlotFillContribution): void {\n const declaration = installingState.slots.get(fill.slot);\n if (declaration === undefined) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'orphan-fill',\n message: `Web plugin '${pluginId}' fills slot '${fill.slot}', which no installed plugin declares; nothing is placed.`,\n });\n return;\n }\n let data = fill.data;\n if (data !== undefined && declaration.parse !== undefined) {\n const parsed = declaration.parse(data);\n if (parsed === null) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'rejected-fill',\n message: `Web plugin '${pluginId}' fill '${fill.id}' into '${fill.slot}' was rejected by the slot's parse gate.`,\n });\n return;\n }\n data = parsed;\n }\n const placed: ResolvedFill = {\n slot: fill.slot,\n pluginId,\n id: fill.id,\n order: fill.order ?? DEFAULT_FILL_ORDER,\n ...(data === undefined ? {} : { data }),\n ...(fill.component === undefined ? {} : { component: fill.component }),\n };\n const list = installingState.fills.get(fill.slot);\n if (list === undefined) installingState.fills.set(fill.slot, [placed]);\n else list.push(placed);\n }\n\n function resolveLeaderConflicts(bindings: readonly PendingBinding[]): void {\n const owner = new Map<LeaderBindingContribution, string>(bindings.map((entry) => [entry.binding, entry.pluginId]));\n for (const conflict of leaderConflicts(bindings.map((entry) => entry.binding))) {\n const winner = owner.get(conflict.winner) ?? '';\n const loser = owner.get(conflict.loser) ?? '';\n if (winner === loser) {\n throw new Error(\n `Web plugin '${winner}' binds Leader Space '${conflict.path}' twice ('${conflict.loser.id}' and '${conflict.winner.id}').`,\n );\n }\n if (conflict.kind === 'leaf-override') {\n installingState.diagnostics.push({\n pluginId: loser,\n kind: 'leader-leaf-override',\n message: `Web plugin '${loser}' Leader Space leaf '${conflict.path}' ('${conflict.loser.id}') is taken over by '${winner}' ('${conflict.winner.id}').`,\n });\n } else {\n installingState.diagnostics.push({\n pluginId: loser,\n kind: 'leader-group-label',\n message: `Web plugin '${loser}' words Leader Space group '${conflict.path}' differently from '${winner}', which named it first; keeping the first label.`,\n });\n }\n }\n }\n\n function buildWebPluginState(\n plugins: readonly WebPluginDefinition[],\n definitions: readonly WebPluginDefinition[] = plugins,\n ): RegistryState {\n const previous = installingState;\n installingState = emptyState();\n try {\n const owners: Record<SharedNamespace, Map<string, string>> = {\n plugin: new Map(),\n tab: new Map(),\n 'dock-face': new Map(),\n channel: new Map(),\n tool: new Map(),\n 'activity-group': new Map(),\n 'minor-mode': new Map(),\n 'selection-axis': new Map(),\n 'palette-command': new Map(),\n 'settings-section': new Map(),\n };\n const pendingFills: PendingFill[] = [];\n const pendingSections: PendingSection[] = [];\n const pendingBindings: PendingBinding[] = [];\n const pendingSlots: SlotDeclaration[] = [];\n\n // Phase 1: collect, in the generated (registrationOrder, pluginId) order.\n for (const plugin of plugins) {\n if (RESERVED_PLUGIN_IDS.has(plugin.id)) {\n throw new Error(`Web plugin id '${plugin.id}' is reserved for a host slot.`);\n }\n if (owners.plugin.has(plugin.id)) {\n installingState.diagnostics.push({\n pluginId: plugin.id,\n kind: 'duplicate-plugin',\n message: `Web plugin id '${plugin.id}' is declared twice; keeping the first definition.`,\n });\n continue;\n }\n owners.plugin.set(plugin.id, plugin.id);\n installingState.plugins.push(plugin);\n for (const tab of plugin.tabs ?? []) {\n if (claim(owners.tab, 'tab', tab.id, plugin.id)) installingState.tabs.push(tab);\n }\n for (const face of plugin.dockFaces ?? []) {\n if (face.id === 'activity' || face.id === 'context') {\n throw new Error(`Web plugin '${plugin.id}' dock face '${face.id}' is reserved by the host.`);\n }\n if (face.id.trim() === '' || face.label.trim() === '') {\n throw new Error(`Web plugin '${plugin.id}' has an unlabeled dock face.`);\n }\n if (claim(owners['dock-face'], 'dock-face', face.id, plugin.id)) installingState.dockFaces.push(face);\n }\n // A panel and a section both become a /settings/:id route, so the two\n // share one id namespace rather than racing to own the same URL.\n for (const section of plugin.settingsSections ?? []) {\n if (claim(owners['settings-section'], 'settings-section', section.id, plugin.id)) {\n installingState.settingsSections.push(section);\n }\n }\n for (const panel of plugin.settingsPanels ?? []) {\n if (claim(owners['settings-section'], 'settings-section', panel.id, plugin.id)) {\n installingState.settingsPanels.push({ pluginId: plugin.id, ...panel });\n }\n }\n for (const channel of plugin.channels ?? []) {\n if (claim(owners.channel, 'channel', channel.channel, plugin.id))\n installingState.channels.set(channel.channel, channel);\n }\n for (const command of plugin.paletteCommands ?? []) {\n if (claim(owners['palette-command'], 'palette-command', command.id, plugin.id))\n installingState.commands.push(command);\n }\n const contextActions = new Set<string>();\n for (const action of plugin.contextActions ?? []) {\n checkContextAction(plugin.id, contextActions, action);\n installingState.contextActions.push({ pluginId: plugin.id, ...action });\n }\n const userMessageActions = new Set<string>();\n for (const action of plugin.userMessageActions ?? []) {\n checkUserMessageAction(plugin.id, userMessageActions, action);\n installingState.userMessageActions.push({ pluginId: plugin.id, ...action });\n }\n for (const binding of plugin.leaderBindings ?? []) {\n checkLeaderBinding(plugin.id, binding);\n pendingBindings.push({ pluginId: plugin.id, binding });\n }\n for (const axis of plugin.selectionAxes ?? []) {\n if (claim(owners['selection-axis'], 'selection-axis', axis.name, plugin.id))\n installingState.selectionAxes.push(axis);\n }\n for (const mode of plugin.minorModes ?? []) {\n if (claim(owners['minor-mode'], 'minor-mode', mode.name, plugin.id)) installingState.minorModes.push(mode);\n }\n for (const group of plugin.activityGroups ?? []) {\n if (claim(owners['activity-group'], 'activity-group', group.name, plugin.id))\n installingState.activityGroups.push(group);\n }\n for (const renderer of plugin.toolRenderers ?? []) {\n for (const tool of renderer.tools) {\n if (claim(owners.tool, 'tool', tool, plugin.id)) installingState.toolRenderers.set(tool, renderer);\n }\n if (renderer.matches !== undefined) installingState.toolMatchers.push(renderer);\n }\n const declared = new Set<string>();\n for (const declaration of plugin.slots ?? []) {\n checkSlotDeclaration(plugin.id, declared, declaration);\n pendingSlots.push(declaration);\n }\n const filled = new Set<string>();\n for (const fill of plugin.fills ?? []) {\n checkFill(plugin.id, filled, fill);\n pendingFills.push({ pluginId: plugin.id, fill });\n }\n for (const surface of plugin.overlays ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.overlay, surface) });\n }\n for (const surface of plugin.railSections ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.rail, surface) });\n }\n for (const surface of plugin.contextSections ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.context, surface) });\n }\n for (const surface of plugin.selectionBarItems ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.selectionBar, surface) });\n }\n for (const surface of plugin.composerActions ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.composerActions, surface) });\n }\n for (const surface of plugin.composerMenuItems ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.composerMenu, surface) });\n }\n for (const section of plugin.activitySections ?? []) pendingSections.push({ pluginId: plugin.id, section });\n if (plugin.fileLinks !== undefined) installingState.fileLinks.push(plugin.fileLinks);\n }\n\n installingState.diagnostics.push(...collectWebTemplates(installingState.plugins).diagnostics);\n\n // Phase 2: resolve by name, now that every declaration is known.\n for (const slot of Object.values(HOST_SLOTS)) installingState.slots.set(slot, { slot });\n installingState.slots.set(HOST_SLOTS.home, { slot: HOST_SLOTS.home, parse: parseHomeContribution });\n for (const group of installingState.activityGroups) {\n installingState.slots.set(activityGroupSlot(group.name), { slot: activityGroupSlot(group.name) });\n }\n for (const declaration of pendingSlots) installingState.slots.set(declaration.slot, declaration);\n for (const { pluginId, section } of pendingSections) {\n const keyed = activityGroupSlot(section.id);\n pendingFills.push({\n pluginId,\n fill: surfaceFill(installingState.slots.has(keyed) ? keyed : HOST_SLOTS.activity, section),\n });\n }\n for (const { pluginId, fill } of pendingFills) {\n if (\n fill.slot === HOST_SLOTS.dashboardTiles &&\n (parseDashboardTileData(fill.data) === null || fill.component === undefined)\n ) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'rejected-fill',\n message: `Web plugin '${pluginId}' dashboard tile '${fill.id}' needs valid presentation data and a body component.`,\n });\n continue;\n }\n if (fill.slot === HOST_SLOTS.home) {\n const data = parseHomeContribution(fill.data);\n const definition = definitions.find((plugin) => plugin.id === pluginId);\n const sources = [definition, definition?.host, definition?.workspace, definition?.session].flatMap(\n (contribution) => contribution?.channels ?? [],\n );\n if (data === null || !sources.some((channel) => channel.channel === data.source)) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'rejected-fill',\n message: `Web plugin '${pluginId}' Home fill '${fill.id}' needs valid data and an owned source channel.`,\n });\n continue;\n }\n }\n placeFill(pluginId, fill);\n }\n for (const list of installingState.fills.values()) list.sort(byFillOrder);\n\n resolveLeaderConflicts(pendingBindings);\n installingState.leaderBindings.push(...pendingBindings.map((entry) => entry.binding));\n installingState.contextActions.sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) ||\n left.pluginId.localeCompare(right.pluginId) ||\n left.id.localeCompare(right.id),\n );\n installingState.userMessageActions.sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) ||\n left.pluginId.localeCompare(right.pluginId) ||\n left.id.localeCompare(right.id),\n );\n installingState.selectionAxes.sort(byDisplayOrder);\n installingState.minorModes.sort(byDisplayOrder);\n installingState.activityGroups.sort(byDisplayOrder);\n installingState.dockFaces.sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) || left.id.localeCompare(right.id),\n );\n return installingState;\n } finally {\n installingState = previous;\n }\n }\n\n /**\n * Live mounts load developer plugins at runtime, so a plugin whose own build\n * throws is skipped with a diagnostic instead of blanking every other plugin.\n */\n function buildLiveState(\n plugins: readonly WebPluginDefinition[],\n definitions: readonly WebPluginDefinition[] = plugins,\n ): RegistryState {\n const rejected: InstallDiagnostic[] = [];\n const admitted = plugins.filter((plugin) => {\n try {\n buildWebPluginState([plugin], definitions);\n return true;\n } catch (error) {\n rejected.push({\n pluginId: plugin.id,\n kind: 'invalid-plugin',\n message: `Web plugin '${plugin.id}' was skipped: ${error instanceof Error ? error.message : String(error)}`,\n });\n return false;\n }\n });\n const state = buildWebPluginState(admitted, definitions);\n state.diagnostics.unshift(...rejected);\n return state;\n }\n\n function installWebPlugins(plugins: readonly WebPluginDefinition[]): void {\n if (defaultInstalled) throw new Error('Web plugins are already installed.');\n defaultState = buildWebPluginState(plugins);\n providers = defaultState.plugins.flatMap((plugin) => {\n const provider = plugin.host?.provider;\n return provider === undefined\n ? []\n : [{ pluginId: hostId === undefined ? plugin.id : qualifyHostId(hostId, plugin.id), provider }];\n });\n installThemes(plugins);\n installingState = defaultState;\n defaultInstalled = true;\n }\n\n function webPluginsInstalled(): boolean {\n return defaultInstalled;\n }\n\n /** Unit-test escape hatch; production installs exactly once. */\n function resetWebPlugins(): void {\n defaultState = emptyState();\n installingState = defaultState;\n defaultInstalled = false;\n providers = [];\n themes = [];\n sessionStates.clear();\n mcpAppRenderers.clear();\n workspaceStates.clear();\n sessionPlugins.clear();\n sessionWorkspaces.clear();\n activeWorkspaceId = null;\n pendingSessionFrames.clear();\n loadDiagnostics.clear();\n activeSessionId = null;\n emitRegistryChange();\n }\n\n /** Installs or atomically replaces one session's independently synchronized plugin definitions. */\n function installSessionWebPlugins(sessionId: string, plugins: readonly WebPluginDefinition[]): void {\n sessionPlugins.set(\n sessionId,\n plugins.flatMap((plugin) => (plugin.session === undefined ? [plugin] : pluginsAtScope([plugin], 'session'))),\n );\n rebuildSession(sessionId);\n // Background-session consumers also wait for their verified composition to arrive.\n emitRegistryChange();\n }\n\n /** Selects which session composition the no-argument contribution readers expose. */\n function activateWebPluginSession(sessionId: string | null): void {\n if (activeSessionId === sessionId) return;\n activeSessionId = sessionId;\n emitRegistryChange();\n }\n\n /** Removes one session registry after its plugin-owned stores have been dropped. */\n function removeSessionWebPlugins(sessionId: string): void {\n const sessionState = sessionStates.get(sessionId);\n pendingSessionFrames.delete(sessionId);\n loadDiagnostics.delete(`session:${sessionId}`);\n if (sessionState === undefined) return;\n for (const channel of sessionState.channels.values()) channel.drop(sessionId);\n sessionStates.delete(sessionId);\n sessionPlugins.delete(sessionId);\n sessionWorkspaces.delete(sessionId);\n if (sessionId === activeSessionId) emitRegistryChange();\n }\n\n function subscribeWebPluginRegistry(listener: () => void): () => void {\n registryListeners.add(listener);\n return () => registryListeners.delete(listener);\n }\n\n function webPluginRegistryRevision(): number {\n return registryRevision;\n }\n\n /**\n * Records the slots one mount could not load, replacing its previous record. The mount still\n * installs the slots that loaded, so one broken plugin never hides the others.\n */\n function setWebPluginLoadDiagnostics(mount: WebPluginMount, diagnostics: readonly InstallDiagnostic[]): void {\n const key =\n mount.scope === 'host'\n ? 'host'\n : mount.scope === 'workspace'\n ? `workspace:${mount.workspaceId}`\n : `session:${mount.sessionId}`;\n if (diagnostics.length === 0 && !loadDiagnostics.has(key)) return;\n if (diagnostics.length === 0) loadDiagnostics.delete(key);\n else loadDiagnostics.set(key, [...diagnostics]);\n emitRegistryChange();\n }\n\n /**\n * What the install had to resolve between plugins, plus the slots the visible mounts could not\n * load; empty for a composition whose plugins all load and never collide.\n */\n function webPluginDiagnostics(): readonly InstallDiagnostic[] {\n const workspaceId =\n (activeSessionId === null ? undefined : sessionWorkspaces.get(activeSessionId)) ?? activeWorkspaceId;\n const failed = [\n 'host',\n ...(workspaceId === null ? [] : [`workspace:${workspaceId}`]),\n ...(activeSessionId === null ? [] : [`session:${activeSessionId}`]),\n ].flatMap((key) => loadDiagnostics.get(key) ?? []);\n const installed = activeState().diagnostics;\n return failed.length === 0 ? installed : [...installed, ...failed];\n }\n\n /** Every installed plugin definition, in install order; the settings page lists them. */\n function installedWebPlugins(): readonly WebPluginDefinition[] {\n return activeState().plugins;\n }\n\n /** Package panels placed under the host's repository controls, in stable display order. */\n function pluginRepositorySettingsPanels(): readonly InstalledRepositorySettingsPanel[] {\n return (workspaceState() ?? emptyState()).plugins\n .flatMap((plugin) =>\n plugin.repositorySettingsPanel === undefined\n ? []\n : [{ pluginId: plugin.id, ...plugin.repositorySettingsPanel }],\n )\n .sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) ||\n left.pluginId.localeCompare(right.pluginId),\n );\n }\n\n function webTabs(sessionId?: string | null): readonly TabContribution[] {\n return activeState(sessionId).tabs;\n }\n\n /** Optional right-dock faces from the active session composition, in display order. */\n function pluginDockFaces(): readonly DockFaceContribution[] {\n return activeState().dockFaces;\n }\n\n /** UI discovery only. Requests still require a proof injected by Electron's main process. */\n function isDesktopClient(): boolean {\n return (\n typeof window !== 'undefined' &&\n (window as Window & { poDesktop?: { platform?: string } }).poDesktop?.platform === 'desktop'\n );\n }\n /**\n * The settings pages plugins contribute, in menu order. Sorted here rather than\n * at the reader so the menu and the page agree without either sorting twice.\n */\n function pluginSettingsSections(scope: 'host' | 'workspace' = 'host'): readonly SettingsSectionContribution[] {\n const sections = (scope === 'host' ? defaultState : workspaceState())?.settingsSections ?? [];\n const visible = isDesktopClient() ? sections : sections.filter((section) => !section.desktopOnly);\n if (!isSelfHostShell()) return visible;\n return visible.map((section) => {\n const fields = section.fields.filter((field) => !field.localOnly);\n return {\n ...section,\n fields,\n ...(section.groups === undefined\n ? {}\n : { groups: section.groups.filter((group) => fields.some((field) => field.group === group.id)) }),\n };\n });\n }\n\n /** The settings pages plugins draw themselves, in install order; the reader sorts them with the sections. */\n function pluginSettingsPanels(): readonly InstalledSettingsPanel[] {\n return defaultState.settingsPanels;\n }\n\n /** The fills placed into one slot, in slot order; empty for a slot nobody declared. */\n function slotFills(slot: string, sessionId?: string | null): readonly ResolvedFill[] {\n return activeState(sessionId).fills.get(slot) ?? [];\n }\n\n /** One workspace's own fills for a slot, whichever session or workspace is focused. */\n function workspaceSlotFills(workspaceId: string, slot: string): readonly ResolvedFill[] {\n return workspaceStates.get(workspaceId)?.fills.get(slot) ?? [];\n }\n\n /** The global plugins' fills for a slot, whichever session or workspace is focused. */\n function globalSlotFills(slot: string): readonly ResolvedFill[] {\n return defaultState.fills.get(slot) ?? [];\n }\n\n /** Dashboard reads never inherit the currently focused session. */\n function dashboardTileFills(mount: Exclude<WebPluginMount, { scope: 'session' }>): readonly InstalledDashboardTile[] {\n const surface = mount.scope === 'workspace' ? 'workspace' : 'home';\n const global = (defaultState.fills.get(HOST_SLOTS.dashboardTiles) ?? []).filter((fill) =>\n ((fill.data as DashboardTileData).surfaces ?? ['home']).includes(surface),\n );\n const workspace =\n mount.scope === 'workspace'\n ? (workspaceStates.get(mount.workspaceId)?.fills.get(HOST_SLOTS.dashboardTiles) ?? [])\n : [];\n const merged = new Map<string, ResolvedFill>();\n for (const fill of [...global, ...workspace]) merged.set(JSON.stringify([fill.pluginId, fill.id]), fill);\n return [...merged.values()].sort(byFillOrder) as InstalledDashboardTile[];\n }\n\n /** A dual-publishing plugin uses its new Home tiles, never both card versions. */\n function legacyHomeAppFills(): readonly ResolvedFill[] {\n const tiled = new Set(dashboardTileFills({ scope: 'host' }).map((fill) => fill.pluginId));\n return globalSlotFills(HOST_SLOTS.homeApps).filter((fill) => !tiled.has(fill.pluginId));\n }\n\n /** Home reads an explicit host mount, never the focused session or workspace. */\n function pluginHomeContributions(\n mount: Exclude<WebPluginMount, { scope: 'session' }>,\n ): readonly InstalledHomeContribution[] {\n const global = defaultState.fills.get(HOST_SLOTS.home) ?? [];\n const workspace =\n mount.scope === 'workspace' ? (workspaceStates.get(mount.workspaceId)?.fills.get(HOST_SLOTS.home) ?? []) : [];\n const seen = new Set<string>();\n const contributions: InstalledHomeContribution[] = [];\n for (const fill of [...global, ...workspace]) {\n const data = parseHomeContribution(fill.data);\n if (data === null) continue;\n const key = `${fill.pluginId}\\0${data.source}`;\n if (seen.has(key)) continue;\n seen.add(key);\n contributions.push({\n pluginId: fill.pluginId,\n id: fill.id,\n order: fill.order,\n data,\n mount: global.includes(fill) ? { scope: 'host' } : mount,\n });\n }\n return contributions.sort(\n (left, right) =>\n left.order - right.order || left.pluginId.localeCompare(right.pluginId) || left.id.localeCompare(right.id),\n );\n }\n\n function paletteCommands(): readonly PaletteCommandContribution[] {\n return activeState().commands;\n }\n\n /** Context actions from every installed plugin, in stable display order. */\n function pluginContextActions(sessionId?: string | null): readonly InstalledContextAction[] {\n return activeState(sessionId).contextActions;\n }\n\n /** User-message actions from every installed plugin, in stable display order. */\n function pluginUserMessageActions(): readonly InstalledUserMessageAction[] {\n return activeState().userMessageActions;\n }\n\n /** Leader Space bindings from every installed plugin, in install order: a later binding on a bound leaf wins. */\n function pluginLeaderBindings(): readonly LeaderBindingContribution[] {\n return activeState().leaderBindings;\n }\n\n /** Selection-axis declarations from every installed plugin, in display order. */\n function pluginSelectionAxes(): readonly SelectionAxisContribution[] {\n return activeState().selectionAxes;\n }\n\n /** Minor-mode declarations from every installed plugin, in display order. */\n function pluginMinorModes(): readonly MinorModeContribution[] {\n return activeState().minorModes;\n }\n\n /** Activity-dock group declarations from every installed plugin, in display order. */\n function pluginActivityGroups(sessionId?: string | null): readonly ActivityGroupContribution[] {\n const groups = activeState(sessionId).activityGroups;\n return isDesktopClient() ? groups : groups.filter((group) => !group.desktopOnly);\n }\n\n /**\n * The file-link sources installed plugins contribute, in install order.\n *\n * More than one is allowed and the first to claim a path wins, the same way a\n * runtime tool matcher does: the host has no way to choose between two\n * packages that both recognise a path, and the alternative is two tabs for one\n * file.\n */\n function pluginFileLinks(sessionId?: string | null): readonly FileLinkSource[] {\n return activeState(sessionId).fileLinks;\n }\n\n /**\n * The renderer a plugin registered for one tool: the exact name claim first,\n * then the first runtime matcher that accepts it, in install order (the one\n * place besides `start` where that order is observable); undefined leaves\n * the host's default card.\n */\n function pluginToolRenderer(\n toolName: string,\n statuses: Readonly<Record<string, string>> = {},\n details?: unknown,\n ): ToolRendererContribution | undefined {\n return resolveToolRenderer(activeState(), toolName, statuses, details);\n }\n\n function resolveToolRenderer(\n state: RegistryState,\n toolName: string,\n statuses: Readonly<Record<string, string>>,\n details: unknown,\n ): ToolRendererContribution | undefined {\n return (\n state.toolRenderers.get(toolName) ??\n state.toolMatchers.find((renderer) => {\n try {\n return renderer.matches?.(toolName, statuses, details);\n } catch {\n // A plugin's predicate must not take down tool cards, prompts or completion routing.\n return false;\n }\n })\n );\n }\n\n /**\n * A session-scoped renderer, resolved the way pluginToolRenderer resolves the\n * active one, or undefined until that session's verified composition is installed.\n */\n function sessionToolRenderer(\n sessionId: string,\n toolName: string,\n statuses: Readonly<Record<string, string>> = {},\n details?: unknown,\n ): ToolRendererContribution | undefined {\n const state = sessionStates.get(sessionId);\n return state === undefined ? undefined : resolveToolRenderer(state, toolName, statuses, details);\n }\n\n function sessionWebPluginsInstalled(sessionId: string): boolean {\n return sessionPlugins.has(sessionId);\n }\n\n /**\n * Routes one wire frame to the channel owning its type. Returns false when no\n * channel claims it, so the demux can fall through silently the way unknown\n * frames always have.\n */\n function dispatchFrameToState(state: RegistryState, frame: Record<string, unknown>): boolean {\n if (typeof frame.type !== 'string' || typeof frame.sessionId !== 'string') return false;\n const channel = state.channels.get(frame.type);\n if (channel === undefined) return false;\n const payload = channel.parse(frame.payload);\n if (payload !== null) channel.apply(frame.sessionId, payload);\n return true;\n }\n\n function dispatchChannelFrame(frame: Record<string, unknown>): boolean {\n if (typeof frame.type !== 'string' || typeof frame.sessionId !== 'string') return false;\n const state = sessionStates.get(frame.sessionId);\n if (state !== undefined) {\n if (dispatchFrameToState(state, frame)) return true;\n } else if (activeSessionId === null) return dispatchFrameToState(defaultState, frame);\n // Channel envelopes carry payload; protocol events do not and must not accumulate.\n if (!Object.hasOwn(frame, 'payload')) return false;\n const pending = pendingSessionFrames.get(frame.sessionId) ?? new Map<string, Record<string, unknown>>();\n if (!pending.has(frame.type) && pending.size >= MAX_PENDING_CHANNEL_TYPES) {\n const oldest = pending.keys().next().value as string | undefined;\n if (oldest !== undefined) pending.delete(oldest);\n }\n pending.set(frame.type, frame);\n pendingSessionFrames.set(frame.sessionId, pending);\n return false;\n }\n\n /** Session teardown: every channel forgets the session's data. */\n function dropPluginSessionData(sessionId: string): void {\n pendingSessionFrames.delete(sessionId);\n const state = sessionStates.get(sessionId) ?? (activeSessionId === null ? defaultState : undefined);\n for (const channel of state?.channels.values() ?? []) channel.drop(sessionId);\n }\n\n const mcpAppRenderers = new Map<string, NonNullable<WebPluginSlotProps['renderMcpApp']>>();\n\n function pluginMcpAppRenderer(sessionId: string | null) {\n return sessionId === null ? undefined : mcpAppRenderers.get(sessionId);\n }\n\n /**\n * Starts every plugin runtime in install order; the disposer runs in reverse. With `onFailure`\n * a plugin whose start throws is reported and skipped, so the others still start.\n */\n function startPluginDefinitions(\n plugins: readonly WebPluginDefinition[],\n runtime: WebPluginRuntime,\n onFailure?: (pluginId: string, error: unknown) => void,\n ): () => void {\n const disposers: Array<() => void> = [];\n const disposeStarted = (): void => {\n for (const dispose of disposers.reverse()) dispose();\n };\n for (const plugin of plugins) {\n try {\n const sessionId = runtime.mount?.scope === 'session' ? runtime.mount.sessionId : undefined;\n const dispose = plugin.start?.({\n ...runtime,\n ...(sessionId === undefined\n ? {}\n : {\n registerMcpAppRenderer(render) {\n mcpAppRenderers.set(sessionId, render);\n const unregister = () => {\n if (mcpAppRenderers.get(sessionId) === render) mcpAppRenderers.delete(sessionId);\n };\n disposers.push(unregister);\n return unregister;\n },\n }),\n });\n if (dispose) disposers.push(dispose);\n } catch (error) {\n if (onFailure) {\n onFailure(plugin.id, error);\n continue;\n }\n disposeStarted();\n throw error;\n }\n }\n return disposeStarted;\n }\n\n function startWebPlugins(runtime: WebPluginRuntime): () => void {\n return startPluginDefinitions(activeState().plugins, runtime);\n }\n\n const owner = <T extends { pluginId: string }>(entry: T): T =>\n hostId === undefined ? entry : { ...entry, pluginId: qualifyHostId(hostId, entry.pluginId) };\n return {\n globalPluginProviders: (): readonly InstalledGlobalPluginProvider[] => providers,\n pluginThemes: (): readonly InstalledPluginTheme[] => themes,\n webTemplateCatalog,\n nativeTemplateCatalog,\n installGlobalWebPlugins,\n installWorkspaceWebPlugins,\n removeWorkspaceWebPlugins,\n activateWebPluginWorkspace,\n bindSessionWebWorkspace,\n installWebPlugins,\n webPluginsInstalled,\n resetWebPlugins,\n installSessionWebPlugins,\n activateWebPluginSession,\n removeSessionWebPlugins,\n subscribeWebPluginRegistry,\n webPluginRegistryRevision,\n setWebPluginLoadDiagnostics,\n webPluginDiagnostics: (...args: Parameters<typeof webPluginDiagnostics>) =>\n webPluginDiagnostics(...args).map(owner),\n installedWebPlugins: () =>\n installedWebPlugins().map((plugin) =>\n hostId === undefined ? plugin : { ...plugin, id: qualifyHostId(hostId, plugin.id) },\n ),\n pluginRepositorySettingsPanels: (...args: Parameters<typeof pluginRepositorySettingsPanels>) =>\n pluginRepositorySettingsPanels(...args).map(owner),\n webTabs,\n pluginDockFaces,\n isDesktopClient,\n pluginSettingsSections,\n pluginSettingsPanels: (...args: Parameters<typeof pluginSettingsPanels>) =>\n pluginSettingsPanels(...args).map(owner),\n slotFills: (...args: Parameters<typeof slotFills>) => slotFills(...args).map(owner),\n workspaceSlotFills: (...args: Parameters<typeof workspaceSlotFills>) => workspaceSlotFills(...args).map(owner),\n globalSlotFills: (...args: Parameters<typeof globalSlotFills>) => globalSlotFills(...args).map(owner),\n dashboardTileFills: (...args: Parameters<typeof dashboardTileFills>) => dashboardTileFills(...args).map(owner),\n legacyHomeAppFills: () => legacyHomeAppFills().map(owner),\n pluginHomeContributions: (...args: Parameters<typeof pluginHomeContributions>) =>\n pluginHomeContributions(...args).map(owner),\n paletteCommands,\n pluginContextActions: (...args: Parameters<typeof pluginContextActions>) =>\n pluginContextActions(...args).map(owner),\n pluginUserMessageActions: (...args: Parameters<typeof pluginUserMessageActions>) =>\n pluginUserMessageActions(...args).map(owner),\n pluginLeaderBindings,\n pluginSelectionAxes,\n pluginMinorModes,\n pluginActivityGroups,\n pluginFileLinks,\n pluginToolRenderer,\n pluginMcpAppRenderer,\n sessionToolRenderer,\n sessionWebPluginsInstalled,\n dispatchChannelFrame,\n dropPluginSessionData,\n startPluginDefinitions,\n startWebPlugins,\n };\n}\n\nexport type WebPluginRegistry = ReturnType<typeof createWebPluginRegistry>;\nconst defaultRegistry = createWebPluginRegistry();\nconst hostRegistries = new Map<string, WebPluginRegistry>();\nlet activeHostId: string | undefined;\nexport function webPluginRegistryForHost(hostId: string): WebPluginRegistry {\n let registry = hostRegistries.get(hostId);\n if (!registry) {\n registry = observeRegistry(createWebPluginRegistry(hostId));\n hostRegistries.set(hostId, registry);\n }\n return registry;\n}\nexport function removeHostWebPlugins(hostId: string): void {\n hostRegistries.get(hostId)?.resetWebPlugins();\n hostRegistries.delete(hostId);\n if (activeHostId === hostId) activeHostId = undefined;\n}\n\nconst registrySubscribers = new Set<() => void>();\nfunction notifyRegistrySubscribers(): void {\n noteStoreUpdate('pluginRegistry', combinedRevision, combinedRevision + 1);\n for (const listener of registrySubscribers) listener();\n}\nlet combinedRevision = 0;\nconst observedRegistries = new WeakSet<WebPluginRegistry>();\nfunction observeRegistry(registry: WebPluginRegistry): WebPluginRegistry {\n if (!observedRegistries.has(registry)) {\n observedRegistries.add(registry);\n registry.subscribeWebPluginRegistry(() => {\n combinedRevision += 1;\n notifyRegistrySubscribers();\n });\n }\n return registry;\n}\n/** Selects host-owned global surfaces when no session or workspace is focused. */\nexport function activateWebPluginHost(hostId: string | undefined): void {\n if (activeHostId === hostId) return;\n activeHostId = hostId;\n combinedRevision += 1;\n notifyRegistrySubscribers();\n}\n\nfunction selectedRegistry(): WebPluginRegistry {\n return activeHostId === undefined ? defaultRegistry : webPluginRegistryForHost(activeHostId);\n}\nfunction registryForKey(key: string): WebPluginRegistry {\n const qualified = splitHostId(key);\n return observeRegistry(qualified === undefined ? defaultRegistry : webPluginRegistryForHost(qualified.hostId));\n}\nfunction registryForMount(mount?: WebPluginMount): WebPluginRegistry {\n return mount === undefined || mount.scope === 'host'\n ? selectedRegistry()\n : registryForKey(mount.scope === 'session' ? mount.sessionId : mount.workspaceId);\n}\n\nexport const webTemplateCatalog: WebPluginRegistry['webTemplateCatalog'] = (...args) =>\n registryForMount(args[0]).webTemplateCatalog(...args);\n\nexport const nativeTemplateCatalog: WebPluginRegistry['nativeTemplateCatalog'] = (...args) =>\n registryForMount(args[0]).nativeTemplateCatalog(...args);\n\nexport const installGlobalWebPlugins: WebPluginRegistry['installGlobalWebPlugins'] = (...args) =>\n selectedRegistry().installGlobalWebPlugins(...args);\n\nexport const installWorkspaceWebPlugins: WebPluginRegistry['installWorkspaceWebPlugins'] = (...args) =>\n registryForKey(args[0]).installWorkspaceWebPlugins(...args);\n\nexport const removeWorkspaceWebPlugins: WebPluginRegistry['removeWorkspaceWebPlugins'] = (...args) =>\n registryForKey(args[0]).removeWorkspaceWebPlugins(...args);\n\nexport const bindSessionWebWorkspace: WebPluginRegistry['bindSessionWebWorkspace'] = (...args) =>\n registryForKey(args[0]).bindSessionWebWorkspace(...args);\n\nexport const installWebPlugins: WebPluginRegistry['installWebPlugins'] = (...args) =>\n selectedRegistry().installWebPlugins(...args);\n\nexport const webPluginsInstalled: WebPluginRegistry['webPluginsInstalled'] = (...args) =>\n selectedRegistry().webPluginsInstalled(...args);\n\nexport const installSessionWebPlugins: WebPluginRegistry['installSessionWebPlugins'] = (...args) =>\n registryForKey(args[0]).installSessionWebPlugins(...args);\n\nexport const removeSessionWebPlugins: WebPluginRegistry['removeSessionWebPlugins'] = (...args) =>\n registryForKey(args[0]).removeSessionWebPlugins(...args);\n\nexport const setWebPluginLoadDiagnostics: WebPluginRegistry['setWebPluginLoadDiagnostics'] = (...args) =>\n registryForMount(args[0]).setWebPluginLoadDiagnostics(...args);\n\nexport const webPluginDiagnostics: WebPluginRegistry['webPluginDiagnostics'] = (...args) =>\n selectedRegistry().webPluginDiagnostics(...args);\n\nexport const installedWebPlugins: WebPluginRegistry['installedWebPlugins'] = (...args) =>\n selectedRegistry().installedWebPlugins(...args);\n\nexport const pluginRepositorySettingsPanels: WebPluginRegistry['pluginRepositorySettingsPanels'] = (...args) =>\n selectedRegistry().pluginRepositorySettingsPanels(...args);\n\nexport const webTabs: WebPluginRegistry['webTabs'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).webTabs(...args);\n\nexport const pluginDockFaces: WebPluginRegistry['pluginDockFaces'] = (...args) =>\n selectedRegistry().pluginDockFaces(...args);\n\nexport const isDesktopClient: WebPluginRegistry['isDesktopClient'] = (...args) =>\n selectedRegistry().isDesktopClient(...args);\n\nexport const pluginSettingsSections: WebPluginRegistry['pluginSettingsSections'] = (...args) =>\n selectedRegistry().pluginSettingsSections(...args);\n\nexport const pluginSettingsPanels: WebPluginRegistry['pluginSettingsPanels'] = (...args) =>\n selectedRegistry().pluginSettingsPanels(...args);\n\nexport const slotFills: WebPluginRegistry['slotFills'] = (...args) =>\n (typeof args[1] === 'string' ? registryForKey(args[1]) : selectedRegistry()).slotFills(...args);\n\nexport const workspaceSlotFills: WebPluginRegistry['workspaceSlotFills'] = (...args) =>\n registryForKey(args[0]).workspaceSlotFills(...args);\n\n/** The themes this browser's own global plugins contribute; a remote host's themes are not the person's. */\nexport function pluginThemes(): readonly InstalledPluginTheme[] {\n return defaultRegistry.pluginThemes();\n}\n\n/**\n * The themes the person's paired computers contribute, for the phone, which pairs only with their\n * own computers. One plugin on two computers is offered once, under its first computer's colours.\n */\nexport function allPluginThemes(): readonly InstalledPluginTheme[] {\n const seen = new Set<string>();\n return [defaultRegistry, ...hostRegistries.values()]\n .flatMap((registry) => registry.pluginThemes())\n .filter(({ theme }) => {\n if (seen.has(theme.name)) return false;\n seen.add(theme.name);\n return true;\n });\n}\n\n/** All host-global providers, default first then host registry creation order, independent of focus. */\nexport function globalPluginProviders(): readonly InstalledGlobalPluginProvider[] {\n return [defaultRegistry, ...hostRegistries.values()].flatMap((registry) => registry.globalPluginProviders());\n}\n\nexport const globalSlotFills: WebPluginRegistry['globalSlotFills'] = (...args) =>\n selectedRegistry().globalSlotFills(...args);\n\nexport const dashboardTileFills: WebPluginRegistry['dashboardTileFills'] = (...args) =>\n registryForMount(args[0]).dashboardTileFills(...args);\n\nexport const legacyHomeAppFills: WebPluginRegistry['legacyHomeAppFills'] = () =>\n selectedRegistry().legacyHomeAppFills();\n\nexport const pluginHomeContributions: WebPluginRegistry['pluginHomeContributions'] = (...args) =>\n registryForMount(args[0]).pluginHomeContributions(...args);\n\nexport const paletteCommands: WebPluginRegistry['paletteCommands'] = (...args) =>\n selectedRegistry().paletteCommands(...args);\n\nexport const pluginContextActions: WebPluginRegistry['pluginContextActions'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginContextActions(...args);\n\nexport const pluginUserMessageActions: WebPluginRegistry['pluginUserMessageActions'] = (...args) =>\n selectedRegistry().pluginUserMessageActions(...args);\n\nexport const pluginLeaderBindings: WebPluginRegistry['pluginLeaderBindings'] = (...args) =>\n selectedRegistry().pluginLeaderBindings(...args);\n\nexport const pluginSelectionAxes: WebPluginRegistry['pluginSelectionAxes'] = (...args) =>\n selectedRegistry().pluginSelectionAxes(...args);\n\nexport const pluginMinorModes: WebPluginRegistry['pluginMinorModes'] = (...args) =>\n selectedRegistry().pluginMinorModes(...args);\n\nexport const pluginActivityGroups: WebPluginRegistry['pluginActivityGroups'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginActivityGroups(...args);\n\nexport const pluginFileLinks: WebPluginRegistry['pluginFileLinks'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginFileLinks(...args);\n\nexport const pluginToolRenderer: WebPluginRegistry['pluginToolRenderer'] = (...args) =>\n selectedRegistry().pluginToolRenderer(...args);\n\nexport const sessionToolRenderer: WebPluginRegistry['sessionToolRenderer'] = (...args) =>\n registryForKey(args[0]).sessionToolRenderer(...args);\n\nexport const sessionWebPluginsInstalled: WebPluginRegistry['sessionWebPluginsInstalled'] = (...args) =>\n registryForKey(args[0]).sessionWebPluginsInstalled(...args);\n\nexport const dispatchChannelFrame: WebPluginRegistry['dispatchChannelFrame'] = (...args) =>\n (typeof args[0].sessionId === 'string' ? registryForKey(args[0].sessionId) : selectedRegistry()).dispatchChannelFrame(\n ...args,\n );\n\nexport const dropPluginSessionData: WebPluginRegistry['dropPluginSessionData'] = (...args) =>\n registryForKey(args[0]).dropPluginSessionData(...args);\n\nexport const startPluginDefinitions: WebPluginRegistry['startPluginDefinitions'] = (...args) =>\n selectedRegistry().startPluginDefinitions(...args);\n\nexport const startWebPlugins: WebPluginRegistry['startWebPlugins'] = (...args) =>\n selectedRegistry().startWebPlugins(...args);\n\nexport function subscribeWebPluginRegistry(listener: () => void): () => void {\n observeRegistry(defaultRegistry);\n registrySubscribers.add(listener);\n return () => registrySubscribers.delete(listener);\n}\nexport function webPluginRegistryRevision(): number {\n return combinedRevision;\n}\nexport function activateWebPluginSession(sessionId: string | null): void {\n const nextHost = sessionId === null ? activeHostId : splitHostId(sessionId)?.hostId;\n const changed = activeHostId !== nextHost;\n activeHostId = nextHost;\n observeRegistry(selectedRegistry()).activateWebPluginSession(sessionId);\n if (changed) {\n combinedRevision += 1;\n notifyRegistrySubscribers();\n }\n}\nexport function activateWebPluginWorkspace(workspaceId: string | null): void {\n const nextHost = workspaceId === null ? activeHostId : splitHostId(workspaceId)?.hostId;\n const changed = activeHostId !== nextHost;\n activeHostId = nextHost;\n observeRegistry(selectedRegistry()).activateWebPluginWorkspace(workspaceId);\n if (changed) {\n combinedRevision += 1;\n notifyRegistrySubscribers();\n }\n}\nexport function resetWebPlugins(): void {\n for (const registry of hostRegistries.values()) registry.resetWebPlugins();\n hostRegistries.clear();\n activeHostId = undefined;\n observeRegistry(defaultRegistry).resetWebPlugins();\n}\n\nexport const pluginMcpAppRenderer: WebPluginRegistry['pluginMcpAppRenderer'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginMcpAppRenderer(...args);\n"],"mappings":";;;;;;;;;;AAyGA,SAAgB,uBAAuB,OAA0C;CAC/E,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GAAG,OAAO;CAChF,MAAM,OAAO;CACb,IAAI,KAAK,YAAY,KAAK,OAAO,KAAK,UAAU,YAAY,KAAK,MAAM,KAAK,MAAM,IAAI,OAAO;CAC7F,IAAI,KAAK,SAAS,KAAA,KAAa,CAAC;EAAC;EAAS;EAAQ;EAAQ;CAAO,CAAC,CAAC,SAAS,KAAK,IAAc,GAAG,OAAO;CACzG,IAAI,KAAK,WAAW,KAAA,KAAa,KAAK,WAAW,UAAU,KAAK,WAAW,QAAQ,OAAO;CAC1F,IACE,KAAK,SAAS,KAAA,KACd,OAAO,KAAK,SAAS,eACpB,OAAO,KAAK,SAAS,YAAY,KAAK,SAAS,OAEhD,OAAO;CACT,IAAI,KAAK,sBAAsB,KAAA,KAAa,OAAO,KAAK,sBAAsB,WAAW,OAAO;CAChG,IACE,KAAK,aAAa,KAAA,MACjB,CAAC,MAAM,QAAQ,KAAK,QAAQ,KAAK,KAAK,SAAS,MAAM,YAAY,YAAY,UAAU,YAAY,WAAW,IAE/G,OAAO;CACT,IAAI,KAAK,SAAS,KAAA,GAAW;EAC3B,IAAI,OAAO,KAAK,SAAS,YAAY,KAAK,SAAS,QAAQ,MAAM,QAAQ,KAAK,IAAI,GAAG,OAAO;EAC5F,MAAM,OAAO,KAAK;EAClB,IAAK,KAAK,SAAS,UAAU,KAAK,SAAS,cAAe,OAAO,KAAK,OAAO,YAAY,KAAK,GAAG,KAAK,MAAM,IAC1G,OAAO;CACX;CACA,OAAO;AACT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ACjC,eAAe;CACf,gBAAgB,iBAAiB,CAAC,CAAC,CAAC,yBAAyB,SAAS;CACtE,IAAI,SAAS;EACX,oBAAoB;EACpB,0BAA0B;CAC5B;AACF;AACA,SAAgB,2BAA2B,aAAkC;CAC3E,MAAM,WAAW,gBAAgB,OAAO,eAAe,YAAY,WAAW,CAAC,EAAE;CACjF,MAAM,UAAU,iBAAiB;CACjC,eAAe;CACf,gBAAgB,iBAAiB,CAAC,CAAC,CAAC,2BAA2B,WAAW;CAC1E,IAAI,SAAS;EACX,oBAAoB;EACpB,0BAA0B;CAC5B;AACF;AACA,SAAgB,kBAAwB;CACtC,KAAK,MAAM,YAAY,eAAe,OAAO,GAAG,SAAS,gBAAgB;CACzE,eAAe,MAAM;CACrB,eAAe,KAAA;CACf,gBAAgB,eAAe,CAAC,CAAC,gBAAgB;AACnD;AAEA,MAAa,wBAAmE,GAAG,UAChF,OAAO,KAAK,OAAO,WAAW,eAAe,KAAK,EAAE,IAAI,iBAAiB,EAAA,CAAG,qBAAqB,GAAG,IAAI"}
1
+ {"version":3,"file":"pluginRegistry.mjs","names":[],"sources":["../../../src/web/lib/pluginRegistry.ts"],"sourcesContent":["import type {\n ActivityGroupContribution,\n ContextActionContribution,\n DashboardTileData,\n DockFaceContribution,\n FileLinkSource,\n LeaderBindingContribution,\n MinorModeContribution,\n PaletteCommandContribution,\n RepositorySettingsPanelContribution,\n SettingsPanelContribution,\n SettingsSectionContribution,\n SelectionAxisContribution,\n SessionChannelContribution,\n SlotDeclaration,\n SlotFillContribution,\n SurfaceContribution,\n TabContribution,\n ToolRendererContribution,\n UserMessageActionContribution,\n WebPluginDefinition,\n WebPluginMount,\n WebPluginRuntime,\n WebPluginSlotProps,\n} from '@agimon-ai/po-core/web';\nimport { activityGroupSlot, HOST_SLOTS, parseHomeContribution, type HomeContribution } from '@agimon-ai/po-core/web';\nexport { activityGroupSlot, HOST_SLOTS } from '@agimon-ai/po-core/web';\nimport type { ComponentType, ReactNode } from 'react';\n\nimport { qualifyHostId, splitHostId } from './hostIdentity';\nimport { leaderConflicts } from './leaderTree';\nimport { mergeScopedPlugins, pluginsAtScope } from './pluginScopes';\nimport { collectPluginThemes, type InstalledPluginTheme } from './pluginThemes';\nimport { isSelfHostShell } from './selfHostShell';\nimport {\n collectNativeTemplates,\n collectWebTemplates,\n type NativeTemplateCatalog,\n type WebTemplateCatalog,\n} from './templateCatalog';\nimport { noteStoreUpdate } from './uiTrace';\n\n/**\n * The installed plugin set.\n *\n * Plain module state rather than a reactive store: the generated plugin list\n * is installed once at startup, before the first render, so every read during\n * render is stable. Install runs in two phases. The first collects every\n * plugin's contributions in the generated order, which is (registrationOrder,\n * pluginId); the second resolves every relation between plugins by name, so\n * a plugin may fill a slot whichever of the two installs first.\n *\n * Plugins are independent and a user may install any of them, so a collision\n * between two plugins never fails the install: a shared name goes to the\n * first plugin (a Leader Space leaf to the later one, as the TUI documents)\n * and the loser is recorded as a diagnostic. Only a malformed contribution\n * inside one plugin throws, because that is a developer error its own tests\n * catch. resetWebPlugins exists for unit tests only.\n */\n\nexport type InstallDiagnosticKind =\n | 'duplicate-plugin'\n | 'duplicate-tab'\n | 'duplicate-dock-face'\n | 'duplicate-channel'\n | 'duplicate-tool'\n | 'duplicate-activity-group'\n | 'duplicate-minor-mode'\n | 'duplicate-selection-axis'\n | 'duplicate-palette-command'\n | 'duplicate-settings-section'\n | 'leader-leaf-override'\n | 'leader-group-label'\n | 'orphan-fill'\n | 'rejected-fill'\n | 'rejected-theme'\n | 'duplicate-theme'\n | 'invalid-template'\n | 'duplicate-template'\n | 'slot-load-failed'\n | 'start-failed'\n | 'invalid-plugin';\n\nexport interface InstallDiagnostic {\n /** The plugin that lost or misfiled the contribution. */\n pluginId: string;\n kind: InstallDiagnosticKind;\n message: string;\n}\n\n/** One placed fill, as the owner's renderSlot and slotData read it. */\nexport interface ResolvedFill {\n slot: string;\n pluginId: string;\n id: string;\n order: number;\n data?: unknown;\n component?: ComponentType<WebPluginSlotProps>;\n}\n\nexport interface InstalledDashboardTile extends ResolvedFill {\n data: DashboardTileData;\n}\n\n/** Reject malformed tile presentation without executing its body. */\nexport function parseDashboardTileData(input: unknown): DashboardTileData | null {\n if (typeof input !== 'object' || input === null || Array.isArray(input)) return null;\n const data = input as Record<string, unknown>;\n if (data.version !== 1 || typeof data.title !== 'string' || data.title.trim() === '') return null;\n if (data.size !== undefined && !['small', 'wide', 'tall', 'large'].includes(data.size as string)) return null;\n if (data.column !== undefined && data.column !== 'main' && data.column !== 'side') return null;\n if (\n data.icon !== undefined &&\n typeof data.icon !== 'function' &&\n (typeof data.icon !== 'object' || data.icon === null)\n )\n return null;\n if (data.combinesComputers !== undefined && typeof data.combinesComputers !== 'boolean') return null;\n if (data.dataScope !== undefined && data.dataScope !== 'host' && data.dataScope !== 'global') return null;\n if (\n data.surfaces !== undefined &&\n (!Array.isArray(data.surfaces) || data.surfaces.some((surface) => surface !== 'home' && surface !== 'workspace'))\n )\n return null;\n if (data.open !== undefined) {\n if (typeof data.open !== 'object' || data.open === null || Array.isArray(data.open)) return null;\n const open = data.open as Record<string, unknown>;\n if ((open.kind !== 'page' && open.kind !== 'settings') || typeof open.id !== 'string' || open.id.trim() === '')\n return null;\n }\n return input as DashboardTileData;\n}\n\nexport interface InstalledContextAction extends ContextActionContribution {\n pluginId: string;\n}\n\nexport interface InstalledUserMessageAction extends UserMessageActionContribution {\n pluginId: string;\n}\n\nconst SLOT_SEPARATOR = '.';\nconst DEFAULT_FILL_ORDER = 1000;\nconst RESERVED_PLUGIN_IDS: ReadonlySet<string> = new Set(Object.values(HOST_SLOTS));\n\ninterface RegistryState {\n plugins: WebPluginDefinition[];\n tabs: TabContribution[];\n dockFaces: DockFaceContribution[];\n channels: Map<string, SessionChannelContribution>;\n commands: PaletteCommandContribution[];\n contextActions: InstalledContextAction[];\n userMessageActions: InstalledUserMessageAction[];\n leaderBindings: LeaderBindingContribution[];\n selectionAxes: SelectionAxisContribution[];\n minorModes: MinorModeContribution[];\n activityGroups: ActivityGroupContribution[];\n settingsSections: SettingsSectionContribution[];\n settingsPanels: InstalledSettingsPanel[];\n toolRenderers: Map<string, ToolRendererContribution>;\n toolMatchers: ToolRendererContribution[];\n slots: Map<string, SlotDeclaration>;\n fills: Map<string, ResolvedFill[]>;\n fileLinks: FileLinkSource[];\n diagnostics: InstallDiagnostic[];\n}\n\nfunction emptyState(): RegistryState {\n return {\n plugins: [],\n tabs: [],\n dockFaces: [],\n channels: new Map(),\n commands: [],\n contextActions: [],\n userMessageActions: [],\n leaderBindings: [],\n selectionAxes: [],\n minorModes: [],\n activityGroups: [],\n settingsSections: [],\n settingsPanels: [],\n toolRenderers: new Map(),\n toolMatchers: [],\n slots: new Map(),\n fills: new Map(),\n fileLinks: [],\n diagnostics: [],\n };\n}\n\nexport interface InstalledRepositorySettingsPanel extends RepositorySettingsPanelContribution {\n pluginId: string;\n}\nexport interface InstalledSettingsPanel extends SettingsPanelContribution {\n pluginId: string;\n}\nexport interface InstalledGlobalPluginProvider {\n pluginId: string;\n provider: ComponentType<{ children?: ReactNode }>;\n}\n\nexport interface InstalledHomeContribution {\n pluginId: string;\n id: string;\n order: number;\n data: HomeContribution;\n mount: Exclude<WebPluginMount, { scope: 'session' }>;\n}\n\n/** An independently owned host plugin registry. */\nexport function createWebPluginRegistry(hostId?: string) {\n let defaultState = emptyState();\n let installingState = defaultState;\n let defaultInstalled = false;\n let providers: readonly InstalledGlobalPluginProvider[] = [];\n let themes: readonly InstalledPluginTheme[] = [];\n const sessionStates = new Map<string, RegistryState>();\n const workspaceStates = new Map<string, RegistryState>();\n const sessionPlugins = new Map<string, readonly WebPluginDefinition[]>();\n const sessionWorkspaces = new Map<string, string>();\n let activeWorkspaceId: string | null = null;\n const pendingSessionFrames = new Map<string, Map<string, Record<string, unknown>>>();\n const MAX_PENDING_CHANNEL_TYPES = 64;\n let activeSessionId: string | null = null;\n /** Slots each mount could not load, keyed `global`, `workspace:<id>` or `session:<id>`. */\n const loadDiagnostics = new Map<string, readonly InstallDiagnostic[]>();\n let registryRevision = 0;\n const registryListeners = new Set<() => void>();\n\n function activeState(sessionId?: string | null): RegistryState {\n if (sessionId !== undefined && sessionId !== null) {\n const workspaceId = sessionWorkspaces.get(sessionId);\n return (\n sessionStates.get(sessionId) ??\n (workspaceId === undefined ? undefined : workspaceStates.get(workspaceId)) ??\n defaultState\n );\n }\n return (\n (activeSessionId === null ? undefined : sessionStates.get(activeSessionId)) ?? workspaceState() ?? defaultState\n );\n }\n\n function workspaceState(): RegistryState | undefined {\n return activeWorkspaceId === null ? undefined : workspaceStates.get(activeWorkspaceId);\n }\n\n /** Settings requests an explicit scope; the cockpit reads its active session composition. */\n function webTemplateCatalog(mount?: WebPluginMount): WebTemplateCatalog {\n if (mount === undefined) {\n const scope = activeSessionId === null ? (activeWorkspaceId === null ? 'host' : 'workspace') : 'session';\n return collectWebTemplates(activeState().plugins, scope);\n }\n if (mount.scope === 'host') return collectWebTemplates(defaultState.plugins, 'host');\n const workspace = workspaceStates.get(mount.workspaceId);\n const plugins = mount.scope === 'session' ? sessionStates.get(mount.sessionId)?.plugins : undefined;\n return collectWebTemplates(\n plugins ?? mergeScopedPlugins(defaultState.plugins, workspace?.plugins ?? []),\n mount.scope,\n );\n }\n\n /** The phone app's layouts at the server-resolved `native.template` mount. */\n function nativeTemplateCatalog(mount: WebPluginMount): NativeTemplateCatalog {\n if (mount.scope === 'host') return collectNativeTemplates(defaultState.plugins, 'host');\n const workspace = workspaceStates.get(mount.workspaceId);\n const plugins = mount.scope === 'session' ? sessionStates.get(mount.sessionId)?.plugins : undefined;\n return collectNativeTemplates(\n plugins ?? mergeScopedPlugins(defaultState.plugins, workspace?.plugins ?? []),\n mount.scope,\n );\n }\n function rebuildSession(sessionId: string): RegistryState {\n const previous = sessionStates.get(sessionId);\n const workspaceId = sessionWorkspaces.get(sessionId);\n const workspace = workspaceId === undefined ? undefined : workspaceStates.get(workspaceId);\n const state = buildLiveState(\n mergeScopedPlugins(defaultState.plugins, workspace?.plugins ?? [], sessionPlugins.get(sessionId) ?? []),\n );\n sessionStates.set(sessionId, state);\n // Drop stale stores before replay, since replacement channels may share a store.\n for (const [type, channel] of previous?.channels.entries() ?? [])\n if (state.channels.get(type) !== channel) channel.drop(sessionId);\n const pending = pendingSessionFrames.get(sessionId);\n if (pending !== undefined) {\n for (const [type, frame] of pending) if (dispatchFrameToState(state, frame)) pending.delete(type);\n if (pending.size === 0) pendingSessionFrames.delete(sessionId);\n }\n return state;\n }\n\n /** Themes are the person's, so only the global plugins contribute them. */\n function installThemes(plugins: readonly WebPluginDefinition[]): void {\n const collected = collectPluginThemes(plugins);\n themes = collected.themes;\n defaultState.diagnostics.push(...collected.diagnostics);\n }\n\n function installGlobalWebPlugins(plugins: readonly WebPluginDefinition[]): void {\n defaultState = buildLiveState(pluginsAtScope(plugins, 'host'), plugins);\n providers = defaultState.plugins.flatMap((plugin) => {\n const provider = plugins.find((definition) => definition.id === plugin.id)?.host?.provider;\n return provider === undefined\n ? []\n : [{ pluginId: hostId === undefined ? plugin.id : qualifyHostId(hostId, plugin.id), provider }];\n });\n installThemes(plugins);\n for (const id of sessionStates.keys()) rebuildSession(id);\n emitRegistryChange();\n }\n\n function installWorkspaceWebPlugins(workspaceId: string, plugins: readonly WebPluginDefinition[]): void {\n const state = buildLiveState(pluginsAtScope(plugins, 'workspace'), plugins);\n workspaceStates.set(workspaceId, state);\n for (const [id, owner] of sessionWorkspaces) if (owner === workspaceId) rebuildSession(id);\n emitRegistryChange();\n }\n\n function removeWorkspaceWebPlugins(workspaceId: string): void {\n workspaceStates.delete(workspaceId);\n loadDiagnostics.delete(`workspace:${workspaceId}`);\n for (const [id, owner] of sessionWorkspaces) if (owner === workspaceId) rebuildSession(id);\n if (activeWorkspaceId === workspaceId) activeWorkspaceId = null;\n emitRegistryChange();\n }\n\n function activateWebPluginWorkspace(workspaceId: string | null): void {\n if (activeWorkspaceId === workspaceId) return;\n activeWorkspaceId = workspaceId;\n emitRegistryChange();\n }\n\n function bindSessionWebWorkspace(sessionId: string, workspaceId: string): void {\n sessionWorkspaces.set(sessionId, workspaceId);\n rebuildSession(sessionId);\n }\n\n function emitRegistryChange(): void {\n registryRevision += 1;\n for (const listener of registryListeners) listener();\n }\n\n /** The TUI's leader alphabet: one lowercase letter or digit per segment. */\n const LEADER_KEY = /^[a-z0-9]$/;\n const MAX_LEADER_PATH = 4;\n\n /**\n * A malformed binding fails the install rather than the keypress: the plugin\n * set is generated at build time, so this is a developer error, and the TUI's\n * registry refuses the same shapes.\n */\n function checkLeaderBinding(pluginId: string, binding: LeaderBindingContribution): void {\n if (binding.path.length === 0 || binding.path.length > MAX_LEADER_PATH) {\n throw new Error(\n `Web plugin '${pluginId}' leader binding '${binding.id}' needs 1 to ${MAX_LEADER_PATH} path segments.`,\n );\n }\n for (const segment of binding.path) {\n if (!LEADER_KEY.test(segment.key)) {\n throw new Error(\n `Web plugin '${pluginId}' leader binding '${binding.id}' key '${segment.key}' must be one lowercase letter or digit.`,\n );\n }\n if (segment.label.trim() === '') {\n throw new Error(`Web plugin '${pluginId}' leader binding '${binding.id}' has an unlabeled segment.`);\n }\n }\n }\n\n interface PendingFill {\n pluginId: string;\n fill: SlotFillContribution;\n }\n\n interface PendingSection {\n pluginId: string;\n section: SurfaceContribution;\n }\n\n interface PendingBinding {\n pluginId: string;\n binding: LeaderBindingContribution;\n }\n\n type SharedNamespace =\n | 'plugin'\n | 'tab'\n | 'dock-face'\n | 'channel'\n | 'tool'\n | 'activity-group'\n | 'minor-mode'\n | 'selection-axis'\n | 'palette-command'\n | 'settings-section';\n\n /**\n * Claims `id` in one shared namespace: false, with a diagnostic, when another\n * plugin already holds it; a throw when this plugin declared it twice, which\n * is a developer error rather than a composition.\n */\n function claim(owners: Map<string, string>, thing: SharedNamespace, id: string, pluginId: string): boolean {\n const holder = owners.get(id);\n if (holder === pluginId) {\n throw new Error(`Web plugin '${pluginId}' declares ${thing.replace('-', ' ')} '${id}' twice.`);\n }\n if (holder !== undefined) {\n installingState.diagnostics.push({\n pluginId,\n kind: `duplicate-${thing}`,\n message: `Web plugin '${pluginId}' ${thing.replace('-', ' ')} '${id}' is already provided by '${holder}'; keeping the first.`,\n });\n return false;\n }\n owners.set(id, pluginId);\n return true;\n }\n\n function surfaceFill(slot: string, surface: SurfaceContribution): SlotFillContribution {\n return { slot, id: surface.id, component: surface.component };\n }\n\n function checkSlotDeclaration(pluginId: string, declared: Set<string>, declaration: SlotDeclaration): void {\n const prefix = `${pluginId}${SLOT_SEPARATOR}`;\n if (!declaration.slot.startsWith(prefix) || declaration.slot.length === prefix.length) {\n throw new Error(\n `Web plugin '${pluginId}' declares slot '${declaration.slot}', which must be named '${prefix}<name>'.`,\n );\n }\n if (declared.has(declaration.slot)) {\n throw new Error(`Web plugin '${pluginId}' declares slot '${declaration.slot}' twice.`);\n }\n declared.add(declaration.slot);\n }\n\n function checkFill(pluginId: string, seen: Set<string>, fill: SlotFillContribution): void {\n if (fill.id === '') throw new Error(`Web plugin '${pluginId}' has a fill into '${fill.slot}' with an empty id.`);\n if (fill.component === undefined && fill.data === undefined) {\n throw new Error(\n `Web plugin '${pluginId}' fill '${fill.id}' into '${fill.slot}' has neither a component nor data.`,\n );\n }\n const key = `${fill.slot} ${fill.id}`;\n if (seen.has(key)) throw new Error(`Web plugin '${pluginId}' fills '${fill.slot}' with id '${fill.id}' twice.`);\n seen.add(key);\n }\n\n function checkContextAction(pluginId: string, seen: Set<string>, action: ContextActionContribution): void {\n if (action.id.trim() === '') throw new Error(`Web plugin '${pluginId}' has a context action with an empty id.`);\n if (seen.has(action.id)) throw new Error(`Web plugin '${pluginId}' declares context action '${action.id}' twice.`);\n if (action.label.trim() === '')\n throw new Error(`Web plugin '${pluginId}' context action '${action.id}' has an empty label.`);\n if (action.kinds.length === 0 || action.kinds.some((kind) => kind.trim() === '')) {\n throw new Error(`Web plugin '${pluginId}' context action '${action.id}' needs non-empty kinds.`);\n }\n seen.add(action.id);\n }\n\n function checkUserMessageAction(pluginId: string, seen: Set<string>, action: UserMessageActionContribution): void {\n if (action.id.trim() === '')\n throw new Error(`Web plugin '${pluginId}' has a user message action with an empty id.`);\n if (seen.has(action.id))\n throw new Error(`Web plugin '${pluginId}' declares user message action '${action.id}' twice.`);\n if (action.label.trim() === '')\n throw new Error(`Web plugin '${pluginId}' user message action '${action.id}' has an empty label.`);\n seen.add(action.id);\n }\n\n const byFillOrder = (left: ResolvedFill, right: ResolvedFill): number =>\n left.order - right.order || left.pluginId.localeCompare(right.pluginId) || left.id.localeCompare(right.id);\n\n const byDisplayOrder = (left: { order?: number; name: string }, right: { order?: number; name: string }): number =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) || left.name.localeCompare(right.name);\n\n function placeFill(pluginId: string, fill: SlotFillContribution): void {\n const declaration = installingState.slots.get(fill.slot);\n if (declaration === undefined) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'orphan-fill',\n message: `Web plugin '${pluginId}' fills slot '${fill.slot}', which no installed plugin declares; nothing is placed.`,\n });\n return;\n }\n let data = fill.data;\n if (data !== undefined && declaration.parse !== undefined) {\n const parsed = declaration.parse(data);\n if (parsed === null) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'rejected-fill',\n message: `Web plugin '${pluginId}' fill '${fill.id}' into '${fill.slot}' was rejected by the slot's parse gate.`,\n });\n return;\n }\n data = parsed;\n }\n const placed: ResolvedFill = {\n slot: fill.slot,\n pluginId,\n id: fill.id,\n order: fill.order ?? DEFAULT_FILL_ORDER,\n ...(data === undefined ? {} : { data }),\n ...(fill.component === undefined ? {} : { component: fill.component }),\n };\n const list = installingState.fills.get(fill.slot);\n if (list === undefined) installingState.fills.set(fill.slot, [placed]);\n else list.push(placed);\n }\n\n function resolveLeaderConflicts(bindings: readonly PendingBinding[]): void {\n const owner = new Map<LeaderBindingContribution, string>(bindings.map((entry) => [entry.binding, entry.pluginId]));\n for (const conflict of leaderConflicts(bindings.map((entry) => entry.binding))) {\n const winner = owner.get(conflict.winner) ?? '';\n const loser = owner.get(conflict.loser) ?? '';\n if (winner === loser) {\n throw new Error(\n `Web plugin '${winner}' binds Leader Space '${conflict.path}' twice ('${conflict.loser.id}' and '${conflict.winner.id}').`,\n );\n }\n if (conflict.kind === 'leaf-override') {\n installingState.diagnostics.push({\n pluginId: loser,\n kind: 'leader-leaf-override',\n message: `Web plugin '${loser}' Leader Space leaf '${conflict.path}' ('${conflict.loser.id}') is taken over by '${winner}' ('${conflict.winner.id}').`,\n });\n } else {\n installingState.diagnostics.push({\n pluginId: loser,\n kind: 'leader-group-label',\n message: `Web plugin '${loser}' words Leader Space group '${conflict.path}' differently from '${winner}', which named it first; keeping the first label.`,\n });\n }\n }\n }\n\n function buildWebPluginState(\n plugins: readonly WebPluginDefinition[],\n definitions: readonly WebPluginDefinition[] = plugins,\n ): RegistryState {\n const previous = installingState;\n installingState = emptyState();\n try {\n const owners: Record<SharedNamespace, Map<string, string>> = {\n plugin: new Map(),\n tab: new Map(),\n 'dock-face': new Map(),\n channel: new Map(),\n tool: new Map(),\n 'activity-group': new Map(),\n 'minor-mode': new Map(),\n 'selection-axis': new Map(),\n 'palette-command': new Map(),\n 'settings-section': new Map(),\n };\n const pendingFills: PendingFill[] = [];\n const pendingSections: PendingSection[] = [];\n const pendingBindings: PendingBinding[] = [];\n const pendingSlots: SlotDeclaration[] = [];\n\n // Phase 1: collect, in the generated (registrationOrder, pluginId) order.\n for (const plugin of plugins) {\n if (RESERVED_PLUGIN_IDS.has(plugin.id)) {\n throw new Error(`Web plugin id '${plugin.id}' is reserved for a host slot.`);\n }\n if (owners.plugin.has(plugin.id)) {\n installingState.diagnostics.push({\n pluginId: plugin.id,\n kind: 'duplicate-plugin',\n message: `Web plugin id '${plugin.id}' is declared twice; keeping the first definition.`,\n });\n continue;\n }\n owners.plugin.set(plugin.id, plugin.id);\n installingState.plugins.push(plugin);\n for (const tab of plugin.tabs ?? []) {\n if (claim(owners.tab, 'tab', tab.id, plugin.id)) installingState.tabs.push(tab);\n }\n for (const face of plugin.dockFaces ?? []) {\n if (face.id === 'activity' || face.id === 'context') {\n throw new Error(`Web plugin '${plugin.id}' dock face '${face.id}' is reserved by the host.`);\n }\n if (face.id.trim() === '' || face.label.trim() === '') {\n throw new Error(`Web plugin '${plugin.id}' has an unlabeled dock face.`);\n }\n if (claim(owners['dock-face'], 'dock-face', face.id, plugin.id)) installingState.dockFaces.push(face);\n }\n // A panel and a section both become a /settings/:id route, so the two\n // share one id namespace rather than racing to own the same URL.\n for (const section of plugin.settingsSections ?? []) {\n if (claim(owners['settings-section'], 'settings-section', section.id, plugin.id)) {\n installingState.settingsSections.push(section);\n }\n }\n for (const panel of plugin.settingsPanels ?? []) {\n if (claim(owners['settings-section'], 'settings-section', panel.id, plugin.id)) {\n installingState.settingsPanels.push({ pluginId: plugin.id, ...panel });\n }\n }\n for (const channel of plugin.channels ?? []) {\n if (claim(owners.channel, 'channel', channel.channel, plugin.id))\n installingState.channels.set(channel.channel, channel);\n }\n for (const command of plugin.paletteCommands ?? []) {\n if (claim(owners['palette-command'], 'palette-command', command.id, plugin.id))\n installingState.commands.push(command);\n }\n const contextActions = new Set<string>();\n for (const action of plugin.contextActions ?? []) {\n checkContextAction(plugin.id, contextActions, action);\n installingState.contextActions.push({ pluginId: plugin.id, ...action });\n }\n const userMessageActions = new Set<string>();\n for (const action of plugin.userMessageActions ?? []) {\n checkUserMessageAction(plugin.id, userMessageActions, action);\n installingState.userMessageActions.push({ pluginId: plugin.id, ...action });\n }\n for (const binding of plugin.leaderBindings ?? []) {\n checkLeaderBinding(plugin.id, binding);\n pendingBindings.push({ pluginId: plugin.id, binding });\n }\n for (const axis of plugin.selectionAxes ?? []) {\n if (claim(owners['selection-axis'], 'selection-axis', axis.name, plugin.id))\n installingState.selectionAxes.push(axis);\n }\n for (const mode of plugin.minorModes ?? []) {\n if (claim(owners['minor-mode'], 'minor-mode', mode.name, plugin.id)) installingState.minorModes.push(mode);\n }\n for (const group of plugin.activityGroups ?? []) {\n if (claim(owners['activity-group'], 'activity-group', group.name, plugin.id))\n installingState.activityGroups.push(group);\n }\n for (const renderer of plugin.toolRenderers ?? []) {\n for (const tool of renderer.tools) {\n if (claim(owners.tool, 'tool', tool, plugin.id)) installingState.toolRenderers.set(tool, renderer);\n }\n if (renderer.matches !== undefined) installingState.toolMatchers.push(renderer);\n }\n const declared = new Set<string>();\n for (const declaration of plugin.slots ?? []) {\n checkSlotDeclaration(plugin.id, declared, declaration);\n pendingSlots.push(declaration);\n }\n const filled = new Set<string>();\n for (const fill of plugin.fills ?? []) {\n checkFill(plugin.id, filled, fill);\n pendingFills.push({ pluginId: plugin.id, fill });\n }\n for (const surface of plugin.overlays ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.overlay, surface) });\n }\n for (const surface of plugin.railSections ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.rail, surface) });\n }\n for (const surface of plugin.contextSections ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.context, surface) });\n }\n for (const surface of plugin.selectionBarItems ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.selectionBar, surface) });\n }\n for (const surface of plugin.composerActions ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.composerActions, surface) });\n }\n for (const surface of plugin.composerMenuItems ?? []) {\n pendingFills.push({ pluginId: plugin.id, fill: surfaceFill(HOST_SLOTS.composerMenu, surface) });\n }\n for (const section of plugin.activitySections ?? []) pendingSections.push({ pluginId: plugin.id, section });\n if (plugin.fileLinks !== undefined) installingState.fileLinks.push(plugin.fileLinks);\n }\n\n installingState.diagnostics.push(...collectWebTemplates(installingState.plugins).diagnostics);\n\n // Phase 2: resolve by name, now that every declaration is known.\n for (const slot of Object.values(HOST_SLOTS)) installingState.slots.set(slot, { slot });\n installingState.slots.set(HOST_SLOTS.home, { slot: HOST_SLOTS.home, parse: parseHomeContribution });\n for (const group of installingState.activityGroups) {\n installingState.slots.set(activityGroupSlot(group.name), { slot: activityGroupSlot(group.name) });\n }\n for (const declaration of pendingSlots) installingState.slots.set(declaration.slot, declaration);\n for (const { pluginId, section } of pendingSections) {\n const keyed = activityGroupSlot(section.id);\n pendingFills.push({\n pluginId,\n fill: surfaceFill(installingState.slots.has(keyed) ? keyed : HOST_SLOTS.activity, section),\n });\n }\n for (const { pluginId, fill } of pendingFills) {\n if (\n fill.slot === HOST_SLOTS.dashboardTiles &&\n (parseDashboardTileData(fill.data) === null || fill.component === undefined)\n ) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'rejected-fill',\n message: `Web plugin '${pluginId}' dashboard tile '${fill.id}' needs valid presentation data and a body component.`,\n });\n continue;\n }\n if (fill.slot === HOST_SLOTS.home) {\n const data = parseHomeContribution(fill.data);\n const definition = definitions.find((plugin) => plugin.id === pluginId);\n const sources = [definition, definition?.host, definition?.workspace, definition?.session].flatMap(\n (contribution) => contribution?.channels ?? [],\n );\n if (data === null || !sources.some((channel) => channel.channel === data.source)) {\n installingState.diagnostics.push({\n pluginId,\n kind: 'rejected-fill',\n message: `Web plugin '${pluginId}' Home fill '${fill.id}' needs valid data and an owned source channel.`,\n });\n continue;\n }\n }\n placeFill(pluginId, fill);\n }\n for (const list of installingState.fills.values()) list.sort(byFillOrder);\n\n resolveLeaderConflicts(pendingBindings);\n installingState.leaderBindings.push(...pendingBindings.map((entry) => entry.binding));\n installingState.contextActions.sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) ||\n left.pluginId.localeCompare(right.pluginId) ||\n left.id.localeCompare(right.id),\n );\n installingState.userMessageActions.sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) ||\n left.pluginId.localeCompare(right.pluginId) ||\n left.id.localeCompare(right.id),\n );\n installingState.selectionAxes.sort(byDisplayOrder);\n installingState.minorModes.sort(byDisplayOrder);\n installingState.activityGroups.sort(byDisplayOrder);\n installingState.dockFaces.sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) || left.id.localeCompare(right.id),\n );\n return installingState;\n } finally {\n installingState = previous;\n }\n }\n\n /**\n * Live mounts load developer plugins at runtime, so a plugin whose own build\n * throws is skipped with a diagnostic instead of blanking every other plugin.\n */\n function buildLiveState(\n plugins: readonly WebPluginDefinition[],\n definitions: readonly WebPluginDefinition[] = plugins,\n ): RegistryState {\n const rejected: InstallDiagnostic[] = [];\n const admitted = plugins.filter((plugin) => {\n try {\n buildWebPluginState([plugin], definitions);\n return true;\n } catch (error) {\n rejected.push({\n pluginId: plugin.id,\n kind: 'invalid-plugin',\n message: `Web plugin '${plugin.id}' was skipped: ${error instanceof Error ? error.message : String(error)}`,\n });\n return false;\n }\n });\n const state = buildWebPluginState(admitted, definitions);\n state.diagnostics.unshift(...rejected);\n return state;\n }\n\n function installWebPlugins(plugins: readonly WebPluginDefinition[]): void {\n if (defaultInstalled) throw new Error('Web plugins are already installed.');\n defaultState = buildWebPluginState(plugins);\n providers = defaultState.plugins.flatMap((plugin) => {\n const provider = plugin.host?.provider;\n return provider === undefined\n ? []\n : [{ pluginId: hostId === undefined ? plugin.id : qualifyHostId(hostId, plugin.id), provider }];\n });\n installThemes(plugins);\n installingState = defaultState;\n defaultInstalled = true;\n }\n\n function webPluginsInstalled(): boolean {\n return defaultInstalled;\n }\n\n /** Unit-test escape hatch; production installs exactly once. */\n function resetWebPlugins(): void {\n defaultState = emptyState();\n installingState = defaultState;\n defaultInstalled = false;\n providers = [];\n themes = [];\n sessionStates.clear();\n mcpAppRenderers.clear();\n workspaceStates.clear();\n sessionPlugins.clear();\n sessionWorkspaces.clear();\n activeWorkspaceId = null;\n pendingSessionFrames.clear();\n loadDiagnostics.clear();\n activeSessionId = null;\n emitRegistryChange();\n }\n\n /** Installs or atomically replaces one session's independently synchronized plugin definitions. */\n function installSessionWebPlugins(sessionId: string, plugins: readonly WebPluginDefinition[]): void {\n sessionPlugins.set(\n sessionId,\n plugins.flatMap((plugin) => (plugin.session === undefined ? [plugin] : pluginsAtScope([plugin], 'session'))),\n );\n rebuildSession(sessionId);\n // Background-session consumers also wait for their verified composition to arrive.\n emitRegistryChange();\n }\n\n /** Selects which session composition the no-argument contribution readers expose. */\n function activateWebPluginSession(sessionId: string | null): void {\n if (activeSessionId === sessionId) return;\n activeSessionId = sessionId;\n emitRegistryChange();\n }\n\n /** Removes one session registry after its plugin-owned stores have been dropped. */\n function removeSessionWebPlugins(sessionId: string): void {\n const sessionState = sessionStates.get(sessionId);\n pendingSessionFrames.delete(sessionId);\n loadDiagnostics.delete(`session:${sessionId}`);\n if (sessionState === undefined) return;\n for (const channel of sessionState.channels.values()) channel.drop(sessionId);\n sessionStates.delete(sessionId);\n sessionPlugins.delete(sessionId);\n sessionWorkspaces.delete(sessionId);\n if (sessionId === activeSessionId) emitRegistryChange();\n }\n\n function subscribeWebPluginRegistry(listener: () => void): () => void {\n registryListeners.add(listener);\n return () => registryListeners.delete(listener);\n }\n\n function webPluginRegistryRevision(): number {\n return registryRevision;\n }\n\n /**\n * Records the slots one mount could not load, replacing its previous record. The mount still\n * installs the slots that loaded, so one broken plugin never hides the others.\n */\n function setWebPluginLoadDiagnostics(mount: WebPluginMount, diagnostics: readonly InstallDiagnostic[]): void {\n const key =\n mount.scope === 'host'\n ? 'host'\n : mount.scope === 'workspace'\n ? `workspace:${mount.workspaceId}`\n : `session:${mount.sessionId}`;\n if (diagnostics.length === 0 && !loadDiagnostics.has(key)) return;\n if (diagnostics.length === 0) loadDiagnostics.delete(key);\n else loadDiagnostics.set(key, [...diagnostics]);\n emitRegistryChange();\n }\n\n /**\n * What the install had to resolve between plugins, plus the slots the visible mounts could not\n * load; empty for a composition whose plugins all load and never collide.\n */\n function webPluginDiagnostics(): readonly InstallDiagnostic[] {\n const workspaceId =\n (activeSessionId === null ? undefined : sessionWorkspaces.get(activeSessionId)) ?? activeWorkspaceId;\n const failed = [\n 'host',\n ...(workspaceId === null ? [] : [`workspace:${workspaceId}`]),\n ...(activeSessionId === null ? [] : [`session:${activeSessionId}`]),\n ].flatMap((key) => loadDiagnostics.get(key) ?? []);\n const installed = activeState().diagnostics;\n return failed.length === 0 ? installed : [...installed, ...failed];\n }\n\n /** Every installed plugin definition, in install order; the settings page lists them. */\n function installedWebPlugins(): readonly WebPluginDefinition[] {\n return activeState().plugins;\n }\n\n /** Package panels placed under the host's repository controls, in stable display order. */\n function pluginRepositorySettingsPanels(): readonly InstalledRepositorySettingsPanel[] {\n return (workspaceState() ?? emptyState()).plugins\n .flatMap((plugin) =>\n plugin.repositorySettingsPanel === undefined\n ? []\n : [{ pluginId: plugin.id, ...plugin.repositorySettingsPanel }],\n )\n .sort(\n (left, right) =>\n (left.order ?? DEFAULT_FILL_ORDER) - (right.order ?? DEFAULT_FILL_ORDER) ||\n left.pluginId.localeCompare(right.pluginId),\n );\n }\n\n function webTabs(sessionId?: string | null): readonly TabContribution[] {\n return activeState(sessionId).tabs;\n }\n\n /** Optional right-dock faces from the active session composition, in display order. */\n function pluginDockFaces(): readonly DockFaceContribution[] {\n return activeState().dockFaces;\n }\n\n /** UI discovery only. Requests still require a proof injected by Electron's main process. */\n function isDesktopClient(): boolean {\n return (\n typeof window !== 'undefined' &&\n (window as Window & { poDesktop?: { platform?: string } }).poDesktop?.platform === 'desktop'\n );\n }\n /**\n * The settings pages plugins contribute, in menu order. Sorted here rather than\n * at the reader so the menu and the page agree without either sorting twice.\n */\n function pluginSettingsSections(scope: 'host' | 'workspace' = 'host'): readonly SettingsSectionContribution[] {\n const sections = (scope === 'host' ? defaultState : workspaceState())?.settingsSections ?? [];\n const visible = isDesktopClient() ? sections : sections.filter((section) => !section.desktopOnly);\n if (!isSelfHostShell()) return visible;\n return visible.map((section) => {\n const fields = section.fields.filter((field) => !field.localOnly);\n return {\n ...section,\n fields,\n ...(section.groups === undefined\n ? {}\n : { groups: section.groups.filter((group) => fields.some((field) => field.group === group.id)) }),\n };\n });\n }\n\n /** The settings pages plugins draw themselves, in install order; the reader sorts them with the sections. */\n function pluginSettingsPanels(): readonly InstalledSettingsPanel[] {\n return defaultState.settingsPanels;\n }\n\n /** The fills placed into one slot, in slot order; empty for a slot nobody declared. */\n function slotFills(slot: string, sessionId?: string | null): readonly ResolvedFill[] {\n return activeState(sessionId).fills.get(slot) ?? [];\n }\n\n /** One workspace's own fills for a slot, whichever session or workspace is focused. */\n function workspaceSlotFills(workspaceId: string, slot: string): readonly ResolvedFill[] {\n return workspaceStates.get(workspaceId)?.fills.get(slot) ?? [];\n }\n\n /** The global plugins' fills for a slot, whichever session or workspace is focused. */\n function globalSlotFills(slot: string): readonly ResolvedFill[] {\n return defaultState.fills.get(slot) ?? [];\n }\n\n /** Dashboard reads never inherit the currently focused session. */\n function dashboardTileFills(mount: Exclude<WebPluginMount, { scope: 'session' }>): readonly InstalledDashboardTile[] {\n const surface = mount.scope === 'workspace' ? 'workspace' : 'home';\n const global = (defaultState.fills.get(HOST_SLOTS.dashboardTiles) ?? []).filter((fill) =>\n ((fill.data as DashboardTileData).surfaces ?? ['home']).includes(surface),\n );\n const workspace =\n mount.scope === 'workspace'\n ? (workspaceStates.get(mount.workspaceId)?.fills.get(HOST_SLOTS.dashboardTiles) ?? [])\n : [];\n const merged = new Map<string, ResolvedFill>();\n for (const fill of [...global, ...workspace]) merged.set(JSON.stringify([fill.pluginId, fill.id]), fill);\n return [...merged.values()].sort(byFillOrder) as InstalledDashboardTile[];\n }\n\n /** A dual-publishing plugin uses its new Home tiles, never both card versions. */\n function legacyHomeAppFills(): readonly ResolvedFill[] {\n const tiled = new Set(dashboardTileFills({ scope: 'host' }).map((fill) => fill.pluginId));\n return globalSlotFills(HOST_SLOTS.homeApps).filter((fill) => !tiled.has(fill.pluginId));\n }\n\n /** Home reads an explicit host mount, never the focused session or workspace. */\n function pluginHomeContributions(\n mount: Exclude<WebPluginMount, { scope: 'session' }>,\n ): readonly InstalledHomeContribution[] {\n const global = defaultState.fills.get(HOST_SLOTS.home) ?? [];\n const workspace =\n mount.scope === 'workspace' ? (workspaceStates.get(mount.workspaceId)?.fills.get(HOST_SLOTS.home) ?? []) : [];\n const seen = new Set<string>();\n const contributions: InstalledHomeContribution[] = [];\n for (const fill of [...global, ...workspace]) {\n const data = parseHomeContribution(fill.data);\n if (data === null) continue;\n const key = `${fill.pluginId}\\0${data.source}`;\n if (seen.has(key)) continue;\n seen.add(key);\n contributions.push({\n pluginId: fill.pluginId,\n id: fill.id,\n order: fill.order,\n data,\n mount: global.includes(fill) ? { scope: 'host' } : mount,\n });\n }\n return contributions.sort(\n (left, right) =>\n left.order - right.order || left.pluginId.localeCompare(right.pluginId) || left.id.localeCompare(right.id),\n );\n }\n\n function paletteCommands(): readonly PaletteCommandContribution[] {\n return activeState().commands;\n }\n\n /** Context actions from every installed plugin, in stable display order. */\n function pluginContextActions(sessionId?: string | null): readonly InstalledContextAction[] {\n return activeState(sessionId).contextActions;\n }\n\n /** User-message actions from every installed plugin, in stable display order. */\n function pluginUserMessageActions(): readonly InstalledUserMessageAction[] {\n return activeState().userMessageActions;\n }\n\n /** Leader Space bindings from every installed plugin, in install order: a later binding on a bound leaf wins. */\n function pluginLeaderBindings(): readonly LeaderBindingContribution[] {\n return activeState().leaderBindings;\n }\n\n /** Selection-axis declarations from every installed plugin, in display order. */\n function pluginSelectionAxes(): readonly SelectionAxisContribution[] {\n return activeState().selectionAxes;\n }\n\n /** Minor-mode declarations from every installed plugin, in display order. */\n function pluginMinorModes(): readonly MinorModeContribution[] {\n return activeState().minorModes;\n }\n\n /** Activity-dock group declarations from every installed plugin, in display order. */\n function pluginActivityGroups(sessionId?: string | null): readonly ActivityGroupContribution[] {\n const groups = activeState(sessionId).activityGroups;\n return isDesktopClient() ? groups : groups.filter((group) => !group.desktopOnly);\n }\n\n /**\n * The file-link sources installed plugins contribute, in install order.\n *\n * More than one is allowed and the first to claim a path wins, the same way a\n * runtime tool matcher does: the host has no way to choose between two\n * packages that both recognise a path, and the alternative is two tabs for one\n * file.\n */\n function pluginFileLinks(sessionId?: string | null): readonly FileLinkSource[] {\n return activeState(sessionId).fileLinks;\n }\n\n /**\n * The renderer a plugin registered for one tool: the exact name claim first,\n * then the first runtime matcher that accepts it, in install order (the one\n * place besides `start` where that order is observable); undefined leaves\n * the host's default card.\n */\n function pluginToolRenderer(\n toolName: string,\n statuses: Readonly<Record<string, string>> = {},\n details?: unknown,\n ): ToolRendererContribution | undefined {\n return resolveToolRenderer(activeState(), toolName, statuses, details);\n }\n\n function resolveToolRenderer(\n state: RegistryState,\n toolName: string,\n statuses: Readonly<Record<string, string>>,\n details: unknown,\n ): ToolRendererContribution | undefined {\n return (\n state.toolRenderers.get(toolName) ??\n state.toolMatchers.find((renderer) => {\n try {\n return renderer.matches?.(toolName, statuses, details);\n } catch {\n // A plugin's predicate must not take down tool cards, prompts or completion routing.\n return false;\n }\n })\n );\n }\n\n /**\n * A session-scoped renderer, resolved the way pluginToolRenderer resolves the\n * active one, or undefined until that session's verified composition is installed.\n */\n function sessionToolRenderer(\n sessionId: string,\n toolName: string,\n statuses: Readonly<Record<string, string>> = {},\n details?: unknown,\n ): ToolRendererContribution | undefined {\n const state = sessionStates.get(sessionId);\n return state === undefined ? undefined : resolveToolRenderer(state, toolName, statuses, details);\n }\n\n function sessionWebPluginsInstalled(sessionId: string): boolean {\n return sessionPlugins.has(sessionId);\n }\n\n /**\n * Routes one wire frame to the channel owning its type. Returns false when no\n * channel claims it, so the demux can fall through silently the way unknown\n * frames always have.\n */\n function dispatchFrameToState(state: RegistryState, frame: Record<string, unknown>): boolean {\n if (typeof frame.type !== 'string' || typeof frame.sessionId !== 'string') return false;\n const channel = state.channels.get(frame.type);\n if (channel === undefined) return false;\n const payload = channel.parse(frame.payload);\n if (payload !== null) channel.apply(frame.sessionId, payload);\n return true;\n }\n\n function dispatchChannelFrame(frame: Record<string, unknown>): boolean {\n if (typeof frame.type !== 'string' || typeof frame.sessionId !== 'string') return false;\n const state = sessionStates.get(frame.sessionId);\n if (state !== undefined) {\n if (dispatchFrameToState(state, frame)) return true;\n } else if (activeSessionId === null) return dispatchFrameToState(defaultState, frame);\n // Channel envelopes carry payload; protocol events do not and must not accumulate.\n if (!Object.hasOwn(frame, 'payload')) return false;\n const pending = pendingSessionFrames.get(frame.sessionId) ?? new Map<string, Record<string, unknown>>();\n if (!pending.has(frame.type) && pending.size >= MAX_PENDING_CHANNEL_TYPES) {\n const oldest = pending.keys().next().value as string | undefined;\n if (oldest !== undefined) pending.delete(oldest);\n }\n pending.set(frame.type, frame);\n pendingSessionFrames.set(frame.sessionId, pending);\n return false;\n }\n\n /** Session teardown: every channel forgets the session's data. */\n function dropPluginSessionData(sessionId: string): void {\n pendingSessionFrames.delete(sessionId);\n const state = sessionStates.get(sessionId) ?? (activeSessionId === null ? defaultState : undefined);\n for (const channel of state?.channels.values() ?? []) channel.drop(sessionId);\n }\n\n const mcpAppRenderers = new Map<string, NonNullable<WebPluginSlotProps['renderMcpApp']>>();\n\n function pluginMcpAppRenderer(sessionId: string | null) {\n return sessionId === null ? undefined : mcpAppRenderers.get(sessionId);\n }\n\n /**\n * Starts every plugin runtime in install order; the disposer runs in reverse. With `onFailure`\n * a plugin whose start throws is reported and skipped, so the others still start.\n */\n function startPluginDefinitions(\n plugins: readonly WebPluginDefinition[],\n runtime: WebPluginRuntime,\n onFailure?: (pluginId: string, error: unknown) => void,\n ): () => void {\n const disposers: Array<() => void> = [];\n const disposeStarted = (): void => {\n for (const dispose of disposers.reverse()) dispose();\n };\n for (const plugin of plugins) {\n try {\n const sessionId = runtime.mount?.scope === 'session' ? runtime.mount.sessionId : undefined;\n const dispose = plugin.start?.({\n ...runtime,\n ...(sessionId === undefined\n ? {}\n : {\n registerMcpAppRenderer(render) {\n mcpAppRenderers.set(sessionId, render);\n const unregister = () => {\n if (mcpAppRenderers.get(sessionId) === render) mcpAppRenderers.delete(sessionId);\n };\n disposers.push(unregister);\n return unregister;\n },\n }),\n });\n if (dispose) disposers.push(dispose);\n } catch (error) {\n if (onFailure) {\n onFailure(plugin.id, error);\n continue;\n }\n disposeStarted();\n throw error;\n }\n }\n return disposeStarted;\n }\n\n function startWebPlugins(runtime: WebPluginRuntime): () => void {\n return startPluginDefinitions(activeState().plugins, runtime);\n }\n\n const owner = <T extends { pluginId: string }>(entry: T): T =>\n hostId === undefined ? entry : { ...entry, pluginId: qualifyHostId(hostId, entry.pluginId) };\n return {\n globalPluginProviders: (): readonly InstalledGlobalPluginProvider[] => providers,\n pluginThemes: (): readonly InstalledPluginTheme[] => themes,\n webTemplateCatalog,\n nativeTemplateCatalog,\n installGlobalWebPlugins,\n installWorkspaceWebPlugins,\n removeWorkspaceWebPlugins,\n activateWebPluginWorkspace,\n bindSessionWebWorkspace,\n installWebPlugins,\n webPluginsInstalled,\n resetWebPlugins,\n installSessionWebPlugins,\n activateWebPluginSession,\n removeSessionWebPlugins,\n subscribeWebPluginRegistry,\n webPluginRegistryRevision,\n setWebPluginLoadDiagnostics,\n webPluginDiagnostics: (...args: Parameters<typeof webPluginDiagnostics>) =>\n webPluginDiagnostics(...args).map(owner),\n installedWebPlugins: () =>\n installedWebPlugins().map((plugin) =>\n hostId === undefined ? plugin : { ...plugin, id: qualifyHostId(hostId, plugin.id) },\n ),\n pluginRepositorySettingsPanels: (...args: Parameters<typeof pluginRepositorySettingsPanels>) =>\n pluginRepositorySettingsPanels(...args).map(owner),\n webTabs,\n pluginDockFaces,\n isDesktopClient,\n pluginSettingsSections,\n pluginSettingsPanels: (...args: Parameters<typeof pluginSettingsPanels>) =>\n pluginSettingsPanels(...args).map(owner),\n slotFills: (...args: Parameters<typeof slotFills>) => slotFills(...args).map(owner),\n workspaceSlotFills: (...args: Parameters<typeof workspaceSlotFills>) => workspaceSlotFills(...args).map(owner),\n globalSlotFills: (...args: Parameters<typeof globalSlotFills>) => globalSlotFills(...args).map(owner),\n dashboardTileFills: (...args: Parameters<typeof dashboardTileFills>) => dashboardTileFills(...args).map(owner),\n legacyHomeAppFills: () => legacyHomeAppFills().map(owner),\n pluginHomeContributions: (...args: Parameters<typeof pluginHomeContributions>) =>\n pluginHomeContributions(...args).map(owner),\n paletteCommands,\n pluginContextActions: (...args: Parameters<typeof pluginContextActions>) =>\n pluginContextActions(...args).map(owner),\n pluginUserMessageActions: (...args: Parameters<typeof pluginUserMessageActions>) =>\n pluginUserMessageActions(...args).map(owner),\n pluginLeaderBindings,\n pluginSelectionAxes,\n pluginMinorModes,\n pluginActivityGroups,\n pluginFileLinks,\n pluginToolRenderer,\n pluginMcpAppRenderer,\n sessionToolRenderer,\n sessionWebPluginsInstalled,\n dispatchChannelFrame,\n dropPluginSessionData,\n startPluginDefinitions,\n startWebPlugins,\n };\n}\n\nexport type WebPluginRegistry = ReturnType<typeof createWebPluginRegistry>;\nconst defaultRegistry = createWebPluginRegistry();\nconst hostRegistries = new Map<string, WebPluginRegistry>();\nlet activeHostId: string | undefined;\nexport function webPluginRegistryForHost(hostId: string): WebPluginRegistry {\n let registry = hostRegistries.get(hostId);\n if (!registry) {\n registry = observeRegistry(createWebPluginRegistry(hostId));\n hostRegistries.set(hostId, registry);\n }\n return registry;\n}\nexport function removeHostWebPlugins(hostId: string): void {\n hostRegistries.get(hostId)?.resetWebPlugins();\n hostRegistries.delete(hostId);\n if (activeHostId === hostId) activeHostId = undefined;\n}\n\nconst registrySubscribers = new Set<() => void>();\nfunction notifyRegistrySubscribers(): void {\n noteStoreUpdate('pluginRegistry', combinedRevision, combinedRevision + 1);\n for (const listener of registrySubscribers) listener();\n}\nlet combinedRevision = 0;\nconst observedRegistries = new WeakSet<WebPluginRegistry>();\nfunction observeRegistry(registry: WebPluginRegistry): WebPluginRegistry {\n if (!observedRegistries.has(registry)) {\n observedRegistries.add(registry);\n registry.subscribeWebPluginRegistry(() => {\n combinedRevision += 1;\n notifyRegistrySubscribers();\n });\n }\n return registry;\n}\n/** Selects host-owned global surfaces when no session or workspace is focused. */\nexport function activateWebPluginHost(hostId: string | undefined): void {\n if (activeHostId === hostId) return;\n activeHostId = hostId;\n combinedRevision += 1;\n notifyRegistrySubscribers();\n}\n\nfunction selectedRegistry(): WebPluginRegistry {\n return activeHostId === undefined ? defaultRegistry : webPluginRegistryForHost(activeHostId);\n}\nfunction registryForKey(key: string): WebPluginRegistry {\n const qualified = splitHostId(key);\n return observeRegistry(qualified === undefined ? defaultRegistry : webPluginRegistryForHost(qualified.hostId));\n}\nfunction registryForMount(mount?: WebPluginMount): WebPluginRegistry {\n return mount === undefined || mount.scope === 'host'\n ? selectedRegistry()\n : registryForKey(mount.scope === 'session' ? mount.sessionId : mount.workspaceId);\n}\n\nexport const webTemplateCatalog: WebPluginRegistry['webTemplateCatalog'] = (...args) =>\n registryForMount(args[0]).webTemplateCatalog(...args);\n\nexport const nativeTemplateCatalog: WebPluginRegistry['nativeTemplateCatalog'] = (...args) =>\n registryForMount(args[0]).nativeTemplateCatalog(...args);\n\nexport const installGlobalWebPlugins: WebPluginRegistry['installGlobalWebPlugins'] = (...args) =>\n selectedRegistry().installGlobalWebPlugins(...args);\n\nexport const installWorkspaceWebPlugins: WebPluginRegistry['installWorkspaceWebPlugins'] = (...args) =>\n registryForKey(args[0]).installWorkspaceWebPlugins(...args);\n\nexport const removeWorkspaceWebPlugins: WebPluginRegistry['removeWorkspaceWebPlugins'] = (...args) =>\n registryForKey(args[0]).removeWorkspaceWebPlugins(...args);\n\nexport const bindSessionWebWorkspace: WebPluginRegistry['bindSessionWebWorkspace'] = (...args) =>\n registryForKey(args[0]).bindSessionWebWorkspace(...args);\n\nexport const installWebPlugins: WebPluginRegistry['installWebPlugins'] = (...args) =>\n selectedRegistry().installWebPlugins(...args);\n\nexport const webPluginsInstalled: WebPluginRegistry['webPluginsInstalled'] = (...args) =>\n selectedRegistry().webPluginsInstalled(...args);\n\nexport const installSessionWebPlugins: WebPluginRegistry['installSessionWebPlugins'] = (...args) =>\n registryForKey(args[0]).installSessionWebPlugins(...args);\n\nexport const removeSessionWebPlugins: WebPluginRegistry['removeSessionWebPlugins'] = (...args) =>\n registryForKey(args[0]).removeSessionWebPlugins(...args);\n\nexport const setWebPluginLoadDiagnostics: WebPluginRegistry['setWebPluginLoadDiagnostics'] = (...args) =>\n registryForMount(args[0]).setWebPluginLoadDiagnostics(...args);\n\nexport const webPluginDiagnostics: WebPluginRegistry['webPluginDiagnostics'] = (...args) =>\n selectedRegistry().webPluginDiagnostics(...args);\n\nexport const installedWebPlugins: WebPluginRegistry['installedWebPlugins'] = (...args) =>\n selectedRegistry().installedWebPlugins(...args);\n\nexport const pluginRepositorySettingsPanels: WebPluginRegistry['pluginRepositorySettingsPanels'] = (...args) =>\n selectedRegistry().pluginRepositorySettingsPanels(...args);\n\nexport const webTabs: WebPluginRegistry['webTabs'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).webTabs(...args);\n\nexport const pluginDockFaces: WebPluginRegistry['pluginDockFaces'] = (...args) =>\n selectedRegistry().pluginDockFaces(...args);\n\nexport const isDesktopClient: WebPluginRegistry['isDesktopClient'] = (...args) =>\n selectedRegistry().isDesktopClient(...args);\n\nexport const pluginSettingsSections: WebPluginRegistry['pluginSettingsSections'] = (...args) =>\n selectedRegistry().pluginSettingsSections(...args);\n\nexport const pluginSettingsPanels: WebPluginRegistry['pluginSettingsPanels'] = (...args) =>\n selectedRegistry().pluginSettingsPanels(...args);\n\nexport const slotFills: WebPluginRegistry['slotFills'] = (...args) =>\n (typeof args[1] === 'string' ? registryForKey(args[1]) : selectedRegistry()).slotFills(...args);\n\nexport const workspaceSlotFills: WebPluginRegistry['workspaceSlotFills'] = (...args) =>\n registryForKey(args[0]).workspaceSlotFills(...args);\n\n/** The themes this browser's own global plugins contribute; a remote host's themes are not the person's. */\nexport function pluginThemes(): readonly InstalledPluginTheme[] {\n return defaultRegistry.pluginThemes();\n}\n\n/**\n * The themes the person's paired computers contribute, for the phone, which pairs only with their\n * own computers. One plugin on two computers is offered once, under its first computer's colours.\n */\nexport function allPluginThemes(): readonly InstalledPluginTheme[] {\n const seen = new Set<string>();\n return [defaultRegistry, ...hostRegistries.values()]\n .flatMap((registry) => registry.pluginThemes())\n .filter(({ theme }) => {\n if (seen.has(theme.name)) return false;\n seen.add(theme.name);\n return true;\n });\n}\n\n/** All host-global providers, default first then host registry creation order, independent of focus. */\nexport function globalPluginProviders(): readonly InstalledGlobalPluginProvider[] {\n return [defaultRegistry, ...hostRegistries.values()].flatMap((registry) => registry.globalPluginProviders());\n}\n\nexport const globalSlotFills: WebPluginRegistry['globalSlotFills'] = (...args) =>\n selectedRegistry().globalSlotFills(...args);\n\nexport const dashboardTileFills: WebPluginRegistry['dashboardTileFills'] = (...args) =>\n registryForMount(args[0]).dashboardTileFills(...args);\n\nexport const legacyHomeAppFills: WebPluginRegistry['legacyHomeAppFills'] = () =>\n selectedRegistry().legacyHomeAppFills();\n\nexport const pluginHomeContributions: WebPluginRegistry['pluginHomeContributions'] = (...args) =>\n registryForMount(args[0]).pluginHomeContributions(...args);\n\nexport const paletteCommands: WebPluginRegistry['paletteCommands'] = (...args) =>\n selectedRegistry().paletteCommands(...args);\n\nexport const pluginContextActions: WebPluginRegistry['pluginContextActions'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginContextActions(...args);\n\nexport const pluginUserMessageActions: WebPluginRegistry['pluginUserMessageActions'] = (...args) =>\n selectedRegistry().pluginUserMessageActions(...args);\n\nexport const pluginLeaderBindings: WebPluginRegistry['pluginLeaderBindings'] = (...args) =>\n selectedRegistry().pluginLeaderBindings(...args);\n\nexport const pluginSelectionAxes: WebPluginRegistry['pluginSelectionAxes'] = (...args) =>\n selectedRegistry().pluginSelectionAxes(...args);\n\nexport const pluginMinorModes: WebPluginRegistry['pluginMinorModes'] = (...args) =>\n selectedRegistry().pluginMinorModes(...args);\n\nexport const pluginActivityGroups: WebPluginRegistry['pluginActivityGroups'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginActivityGroups(...args);\n\nexport const pluginFileLinks: WebPluginRegistry['pluginFileLinks'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginFileLinks(...args);\n\nexport const pluginToolRenderer: WebPluginRegistry['pluginToolRenderer'] = (...args) =>\n selectedRegistry().pluginToolRenderer(...args);\n\nexport const sessionToolRenderer: WebPluginRegistry['sessionToolRenderer'] = (...args) =>\n registryForKey(args[0]).sessionToolRenderer(...args);\n\nexport const sessionWebPluginsInstalled: WebPluginRegistry['sessionWebPluginsInstalled'] = (...args) =>\n registryForKey(args[0]).sessionWebPluginsInstalled(...args);\n\nexport const dispatchChannelFrame: WebPluginRegistry['dispatchChannelFrame'] = (...args) =>\n (typeof args[0].sessionId === 'string' ? registryForKey(args[0].sessionId) : selectedRegistry()).dispatchChannelFrame(\n ...args,\n );\n\nexport const dropPluginSessionData: WebPluginRegistry['dropPluginSessionData'] = (...args) =>\n registryForKey(args[0]).dropPluginSessionData(...args);\n\nexport const startPluginDefinitions: WebPluginRegistry['startPluginDefinitions'] = (...args) =>\n selectedRegistry().startPluginDefinitions(...args);\n\nexport const startWebPlugins: WebPluginRegistry['startWebPlugins'] = (...args) =>\n selectedRegistry().startWebPlugins(...args);\n\nexport function subscribeWebPluginRegistry(listener: () => void): () => void {\n observeRegistry(defaultRegistry);\n registrySubscribers.add(listener);\n return () => registrySubscribers.delete(listener);\n}\nexport function webPluginRegistryRevision(): number {\n return combinedRevision;\n}\nexport function activateWebPluginSession(sessionId: string | null): void {\n const nextHost = sessionId === null ? activeHostId : splitHostId(sessionId)?.hostId;\n const changed = activeHostId !== nextHost;\n activeHostId = nextHost;\n observeRegistry(selectedRegistry()).activateWebPluginSession(sessionId);\n if (changed) {\n combinedRevision += 1;\n notifyRegistrySubscribers();\n }\n}\nexport function activateWebPluginWorkspace(workspaceId: string | null): void {\n const nextHost = workspaceId === null ? activeHostId : splitHostId(workspaceId)?.hostId;\n const changed = activeHostId !== nextHost;\n activeHostId = nextHost;\n observeRegistry(selectedRegistry()).activateWebPluginWorkspace(workspaceId);\n if (changed) {\n combinedRevision += 1;\n notifyRegistrySubscribers();\n }\n}\nexport function resetWebPlugins(): void {\n for (const registry of hostRegistries.values()) registry.resetWebPlugins();\n hostRegistries.clear();\n activeHostId = undefined;\n observeRegistry(defaultRegistry).resetWebPlugins();\n}\n\nexport const pluginMcpAppRenderer: WebPluginRegistry['pluginMcpAppRenderer'] = (...args) =>\n (typeof args[0] === 'string' ? registryForKey(args[0]) : selectedRegistry()).pluginMcpAppRenderer(...args);\n"],"mappings":";;;;;;;;;;AAyGA,SAAgB,uBAAuB,OAA0C;CAC/E,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GAAG,OAAO;CAChF,MAAM,OAAO;CACb,IAAI,KAAK,YAAY,KAAK,OAAO,KAAK,UAAU,YAAY,KAAK,MAAM,KAAK,MAAM,IAAI,OAAO;CAC7F,IAAI,KAAK,SAAS,KAAA,KAAa,CAAC;EAAC;EAAS;EAAQ;EAAQ;CAAO,CAAC,CAAC,SAAS,KAAK,IAAc,GAAG,OAAO;CACzG,IAAI,KAAK,WAAW,KAAA,KAAa,KAAK,WAAW,UAAU,KAAK,WAAW,QAAQ,OAAO;CAC1F,IACE,KAAK,SAAS,KAAA,KACd,OAAO,KAAK,SAAS,eACpB,OAAO,KAAK,SAAS,YAAY,KAAK,SAAS,OAEhD,OAAO;CACT,IAAI,KAAK,sBAAsB,KAAA,KAAa,OAAO,KAAK,sBAAsB,WAAW,OAAO;CAChG,IAAI,KAAK,cAAc,KAAA,KAAa,KAAK,cAAc,UAAU,KAAK,cAAc,UAAU,OAAO;CACrG,IACE,KAAK,aAAa,KAAA,MACjB,CAAC,MAAM,QAAQ,KAAK,QAAQ,KAAK,KAAK,SAAS,MAAM,YAAY,YAAY,UAAU,YAAY,WAAW,IAE/G,OAAO;CACT,IAAI,KA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C,SAAgB,2BAA2B,UAAkC;CAC3E,gBAAgB,eAAe;CAC/B,oBAAoB,IAAI,QAAQ;CAChC,aAAa,oBAAoB,OAAO,QAAQ;AAClD;AACA,SAAgB,4BAAoC;CAClD,OAAO;AACT;AACA,SAAgB,yBAAyB,WAAgC;CACvE,MAAM,WAAW,cAAc,OAAO,eAAe,YAAY,SAAS,CAAC,EAAE;CAC7E,MAAM,UAAU,iBAAiB;CACjC,eAAe;CACf,gBAAgB,iBAAiB,CAAC,CAAC,CAAC,yBAAyB,SAAS;CACtE,IAAI,SAAS;EACX,oBAAoB;EACpB,0BAA0B;CAC5B;AACF;AACA,SAAgB,2BAA2B,aAAkC;CAC3E,MAAM,WAAW,gBAAgB,OAAO,eAAe,YAAY,WAAW,CAAC,EAAE;CACjF,MAAM,UAAU,iBAAiB;CACjC,eAAe;CACf,gBAAgB,iBAAiB,CAAC,CAAC,CAAC,2BAA2B,WAAW;CAC1E,IAAI,SAAS;EACX,oBAAoB;EACpB,0BAA0B;CAC5B;AACF;AACA,SAAgB,kBAAwB;CACtC,KAAK,MAAM,YAAY,eAAe,OAAO,GAAG,SAAS,gBAAgB;CACzE,eAAe,MAAM;CACrB,eAAe,KAAA;CACf,gBAAgB,eAAe,CAAC,CAAC,gBAAgB;AACnD;AAEA,MAAa,wBAAmE,GAAG,UAChF,OAAO,KAAK,OAAO,WAAW,eAAe,KAAK,EAAE,IAAI,iBAAiB,EAAA,CAAG,qBAAqB,GAAG,IAAI"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po-web-dashboard",
3
- "version": "0.0.0-alpha.141",
3
+ "version": "0.0.0-alpha.142",
4
4
  "description": "Shared browser state, actions and optional views for Po dashboard templates.",
5
5
  "keywords": [
6
6
  "ai",
@@ -61,9 +61,9 @@
61
61
  "access": "public"
62
62
  },
63
63
  "dependencies": {
64
- "@agimon-ai/po-core": "0.0.0-alpha.141",
65
- "@agimon-ai/po-web-components": "0.0.0-alpha.141",
66
- "@agimon-ai/po-web-security": "0.0.0-alpha.141",
64
+ "@agimon-ai/po-core": "0.0.0-alpha.142",
65
+ "@agimon-ai/po-web-components": "0.0.0-alpha.142",
66
+ "@agimon-ai/po-web-security": "0.0.0-alpha.142",
67
67
  "@earendil-works/chord": "1.5.1",
68
68
  "@simplewebauthn/browser": "^14.0.0",
69
69
  "@tanstack/react-router": "1.170.45",
@@ -73,7 +73,7 @@
73
73
  "qrcode-generator": "^2.0.4"
74
74
  },
75
75
  "devDependencies": {
76
- "@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.141",
76
+ "@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.142",
77
77
  "@types/node": "26.6.5",
78
78
  "@types/react": "19.3.0",
79
79
  "@types/react-dom": "19.3.0",