import { homeAppEntries } from "./homeApps.mjs"; import { InstalledPluginLocale } from "./pluginLocales.mjs"; import { InstalledPluginTheme } from "./pluginThemes.mjs"; import { NativeTemplateCatalog, WebTemplateCatalog } from "./templateCatalog.mjs"; import { ActivityGroupContribution, ContextActionContribution, DashboardTileData, DockFaceContribution, FileLinkSource, HOST_SLOTS as HOST_SLOTS$1, HomeContribution, LeaderBindingContribution, ModeContribution, OnboardingContribution, PaletteCommandContribution, RepositorySettingsPanelContribution, SelectionAxisContribution, SettingsPanelContribution, SettingsSectionContribution, TabContribution, ToolRendererContribution, UserMessageActionContribution, WebPluginDefinition, WebPluginMount, WebPluginRuntime, WebPluginSlotProps, activityGroupSlot as activityGroupSlot$1 } from "@agimon-ai/po-core/web"; import { ComponentType, ReactNode } from "react"; //#region src/web/lib/pluginRegistry.d.ts /** * The installed plugin set. * * Plain module state rather than a reactive store: the generated plugin list * is installed once at startup, before the first render, so every read during * render is stable. Install runs in two phases. The first collects every * plugin's contributions in the generated order, which is (registrationOrder, * pluginId); the second resolves every relation between plugins by name, so * a plugin may fill a slot whichever of the two installs first. * * Plugins are independent and a user may install any of them, so a collision * between two plugins never fails the install: a shared name goes to the * first plugin (a Leader Space leaf to the later one, as the TUI documents) * and the loser is recorded as a diagnostic. Only a malformed contribution * inside one plugin throws, because that is a developer error its own tests * catch. resetWebPlugins exists for unit tests only. */ export type InstallDiagnosticKind = 'duplicate-plugin' | 'duplicate-tab' | 'duplicate-dock-face' | 'duplicate-channel' | 'duplicate-tool' | 'duplicate-activity-group' | 'duplicate-mode' | 'duplicate-selection-axis' | 'duplicate-palette-command' | 'duplicate-settings-section' | 'leader-leaf-override' | 'leader-group-label' | 'orphan-fill' | 'rejected-fill' | 'rejected-theme' | 'duplicate-theme' | 'rejected-locale' | 'invalid-onboarding' | 'invalid-template' | 'duplicate-template' | 'slot-load-failed' | 'render-failed' | 'start-failed' | 'invalid-plugin'; export interface InstallDiagnostic { /** The plugin that lost or misfiled the contribution. */ pluginId: string; kind: InstallDiagnosticKind; message: string; } /** One placed fill, as the owner's renderSlot and slotData read it. */ export interface ResolvedFill { slot: string; pluginId: string; id: string; order: number; data?: unknown; component?: ComponentType; } export interface InstalledDashboardTile extends ResolvedFill { data: DashboardTileData; } /** Reject malformed tile presentation without executing its body. */ export declare function parseDashboardTileData(input: unknown): DashboardTileData | null; export interface InstalledContextAction extends ContextActionContribution { pluginId: string; } export interface InstalledUserMessageAction extends UserMessageActionContribution { pluginId: string; } export interface InstalledRepositorySettingsPanel extends RepositorySettingsPanelContribution { pluginId: string; } export interface InstalledSettingsSection extends SettingsSectionContribution { pluginId: string; } export interface InstalledOnboarding extends OnboardingContribution { pluginId: string; /** The package that ships it, which is how a curated plugin finds its own setup. */ packageName?: string; } export interface InstalledSettingsPanel extends SettingsPanelContribution { pluginId: string; } export interface InstalledHostPluginProvider { pluginId: string; provider: ComponentType<{ children?: ReactNode; }>; } export interface InstalledHomeContribution { pluginId: string; id: string; order: number; data: HomeContribution; mount: Exclude; /** A web fill may name its icon beside the wire fields; the phone draws none. */ icon?: DashboardTileData['icon']; } /** An independently owned host plugin registry. */ export declare function createWebPluginRegistry(hostId?: string): { hostPluginProviders: () => readonly InstalledHostPluginProvider[]; pluginThemes: () => readonly InstalledPluginTheme[]; pluginLocales: () => readonly InstalledPluginLocale[]; webTemplateCatalog: (mount?: WebPluginMount) => WebTemplateCatalog; nativeTemplateCatalog: (mount: WebPluginMount) => NativeTemplateCatalog; pluginOnboarding: () => readonly InstalledOnboarding[]; installHostWebPlugins: (plugins: readonly WebPluginDefinition[]) => void; installWorkspaceWebPlugins: (workspaceId: string, plugins: readonly WebPluginDefinition[]) => void; removeWorkspaceWebPlugins: (workspaceId: string) => void; activateWebPluginWorkspace: (workspaceId: string | null) => void; bindSessionWebWorkspace: (sessionId: string, workspaceId: string) => void; installWebPlugins: (plugins: readonly WebPluginDefinition[]) => void; webPluginsInstalled: () => boolean; resetWebPlugins: () => void; installSessionWebPlugins: (sessionId: string, plugins: readonly WebPluginDefinition[]) => void; activateWebPluginSession: (sessionId: string | null) => void; removeSessionWebPlugins: (sessionId: string) => void; subscribeWebPluginRegistry: (listener: () => void) => () => void; webPluginRegistryRevision: () => number; setWebPluginLoadDiagnostics: (mount: WebPluginMount, diagnostics: readonly InstallDiagnostic[]) => void; recordWebPluginRenderFailure: (pluginId: string, fillId: string, slot: string) => void; webPluginDiagnostics: (...args: Parameters<() => readonly InstallDiagnostic[]>) => InstallDiagnostic[]; installedWebPlugins: () => WebPluginDefinition[]; pluginRepositorySettingsPanels: (...args: Parameters<() => readonly InstalledRepositorySettingsPanel[]>) => InstalledRepositorySettingsPanel[]; webTabs: (sessionId?: string | null) => readonly TabContribution[]; pluginDockFaces: () => readonly DockFaceContribution[]; isDesktopClient: () => boolean; pluginSettingsSections: (scope?: 'host' | 'workspace') => readonly InstalledSettingsSection[]; pluginSettingsPanels: (...args: Parameters<() => readonly InstalledSettingsPanel[]>) => InstalledSettingsPanel[]; slotFills: (...args: Parameters<(slot: string, sessionId?: string | null) => readonly ResolvedFill[]>) => ResolvedFill[]; workspaceSlotFills: (...args: Parameters<(workspaceId: string, slot: string) => readonly ResolvedFill[]>) => ResolvedFill[]; hostSlotFills: (...args: Parameters<(slot: string) => readonly ResolvedFill[]>) => ResolvedFill[]; dashboardTileFills: (...args: Parameters<(mount: Exclude) => readonly InstalledDashboardTile[]>) => InstalledDashboardTile[]; legacyHomeAppFills: () => ResolvedFill[]; pluginHomeContributions: (...args: Parameters<(mount: Exclude) => readonly InstalledHomeContribution[]>) => InstalledHomeContribution[]; paletteCommands: () => readonly PaletteCommandContribution[]; pluginContextActions: (...args: Parameters<(sessionId?: string | null) => readonly InstalledContextAction[]>) => InstalledContextAction[]; pluginUserMessageActions: (...args: Parameters<() => readonly InstalledUserMessageAction[]>) => InstalledUserMessageAction[]; pluginLeaderBindings: () => readonly LeaderBindingContribution[]; pluginSelectionAxes: () => readonly SelectionAxisContribution[]; pluginModes: () => readonly ModeContribution[]; pluginActivityGroups: (sessionId?: string | null) => readonly ActivityGroupContribution[]; pluginFileLinks: (sessionId?: string | null) => readonly FileLinkSource[]; pluginToolRenderer: (toolName: string, statuses?: Readonly>, details?: unknown) => ToolRendererContribution | undefined; pluginMcpAppRenderer: (sessionId: string | null) => ((request: { key: string; toolCallId: string; }) => ReactNode) | undefined; sessionToolRenderer: (sessionId: string, toolName: string, statuses?: Readonly>, details?: unknown) => ToolRendererContribution | undefined; sessionWebPluginsInstalled: (sessionId: string) => boolean; dispatchChannelFrame: (frame: Record) => boolean; dropPluginSessionData: (sessionId: string) => void; startPluginDefinitions: (plugins: readonly WebPluginDefinition[], runtime: WebPluginRuntime, onFailure?: (pluginId: string, error: unknown) => void) => () => void; startWebPlugins: (runtime: WebPluginRuntime) => () => void; }; export type WebPluginRegistry = ReturnType; /** Hosts whose plugin definitions are available to this dashboard. */ export declare function registeredWebPluginHostIds(): readonly string[]; export declare function webPluginRegistryForHost(hostId: string): WebPluginRegistry; export declare function removeHostWebPlugins(hostId: string): void; /** Selects host-owned host surfaces when no session or workspace is focused. */ export declare function activateWebPluginHost(hostId: string | undefined): void; export declare const webTemplateCatalog: WebPluginRegistry['webTemplateCatalog']; export declare const nativeTemplateCatalog: WebPluginRegistry['nativeTemplateCatalog']; /** Installs the shell's own host composition, regardless of which session is focused. */ export declare const installHostWebPlugins: WebPluginRegistry['installHostWebPlugins']; export declare const installWorkspaceWebPlugins: WebPluginRegistry['installWorkspaceWebPlugins']; export declare const removeWorkspaceWebPlugins: WebPluginRegistry['removeWorkspaceWebPlugins']; export declare const bindSessionWebWorkspace: WebPluginRegistry['bindSessionWebWorkspace']; export declare const installWebPlugins: WebPluginRegistry['installWebPlugins']; export declare const webPluginsInstalled: WebPluginRegistry['webPluginsInstalled']; export declare const installSessionWebPlugins: WebPluginRegistry['installSessionWebPlugins']; export declare const removeSessionWebPlugins: WebPluginRegistry['removeSessionWebPlugins']; export declare const setWebPluginLoadDiagnostics: WebPluginRegistry['setWebPluginLoadDiagnostics']; export declare const recordWebPluginRenderFailure: WebPluginRegistry['recordWebPluginRenderFailure']; export declare const webPluginDiagnostics: WebPluginRegistry['webPluginDiagnostics']; export declare const installedWebPlugins: WebPluginRegistry['installedWebPlugins']; export declare const pluginRepositorySettingsPanels: WebPluginRegistry['pluginRepositorySettingsPanels']; export declare const webTabs: WebPluginRegistry['webTabs']; export declare const pluginDockFaces: WebPluginRegistry['pluginDockFaces']; export declare const isDesktopClient: WebPluginRegistry['isDesktopClient']; export declare const pluginSettingsSections: WebPluginRegistry['pluginSettingsSections']; export declare const pluginSettingsPanels: WebPluginRegistry['pluginSettingsPanels']; export declare const slotFills: WebPluginRegistry['slotFills']; export declare const workspaceSlotFills: WebPluginRegistry['workspaceSlotFills']; /** The themes this browser's own host plugins contribute; a remote host's themes are not the person's. */ export declare function pluginThemes(): readonly InstalledPluginTheme[]; /** The languages every paired host's plugins contribute, one per tag, for the language picker. */ export declare function allPluginLocales(): readonly InstalledPluginLocale[]; /** * The themes the person's paired computers contribute, for the phone, which pairs only with their * own computers. One plugin on two computers is offered once, under its first computer's colours. */ export declare function allPluginThemes(): readonly InstalledPluginTheme[]; /** All host-host providers, default first then host registry creation order, independent of focus. */ export declare function hostPluginProviders(): readonly InstalledHostPluginProvider[]; export declare function installBundledWebPlugins(plugins: readonly WebPluginDefinition[]): void; /** A host's copy of a bundled plugin never renders: the app's own copy wins, whichever host is selected. */ export declare const hostSlotFills: WebPluginRegistry['hostSlotFills']; export declare const dashboardTileFills: WebPluginRegistry['dashboardTileFills']; /** Home contributions keep their supplying host, deduplicating only explicitly shared data. */ export declare function dashboardTileFillsAcrossHosts(hosts: Parameters[0], admit?: (hostId: string, pluginId: string) => boolean): { hostId: string; fill: InstalledDashboardTile; key: string; global: boolean; }[]; /** Host-host slots are joined independently of the focused session or workspace. */ export declare function hostSlotFillsAcrossHosts(hosts: Parameters[0], slot: string, admit?: (hostId: string, pluginId: string) => boolean): { hostId: string; fill: ResolvedFill; key: string; global: boolean; }[]; export declare const legacyHomeAppFills: WebPluginRegistry['legacyHomeAppFills']; export declare const pluginHomeContributions: WebPluginRegistry['pluginHomeContributions']; export declare const paletteCommands: WebPluginRegistry['paletteCommands']; export declare const pluginContextActions: WebPluginRegistry['pluginContextActions']; export declare const pluginUserMessageActions: WebPluginRegistry['pluginUserMessageActions']; export declare const pluginLeaderBindings: WebPluginRegistry['pluginLeaderBindings']; export declare const pluginSelectionAxes: WebPluginRegistry['pluginSelectionAxes']; export declare const pluginModes: WebPluginRegistry['pluginModes']; export declare const pluginActivityGroups: WebPluginRegistry['pluginActivityGroups']; export declare const pluginFileLinks: WebPluginRegistry['pluginFileLinks']; export declare const pluginToolRenderer: WebPluginRegistry['pluginToolRenderer']; export declare const sessionToolRenderer: WebPluginRegistry['sessionToolRenderer']; export declare const sessionWebPluginsInstalled: WebPluginRegistry['sessionWebPluginsInstalled']; export declare const dispatchChannelFrame: WebPluginRegistry['dispatchChannelFrame']; export declare const dropPluginSessionData: WebPluginRegistry['dropPluginSessionData']; export declare const startPluginDefinitions: WebPluginRegistry['startPluginDefinitions']; export declare const startWebPlugins: WebPluginRegistry['startWebPlugins']; export declare function subscribeWebPluginRegistry(listener: () => void): () => void; export declare function webPluginRegistryRevision(): number; export declare function activateWebPluginSession(sessionId: string | null): void; export declare function activateWebPluginWorkspace(workspaceId: string | null): void; /** Sets the shell platform identity from the web shell entrypoint instead of sniffing `window.poDesktop`. */ export declare function setWebPluginHostPlatform(platform: string | undefined): void; export declare function resetWebPlugins(): void; export declare const pluginMcpAppRenderer: WebPluginRegistry['pluginMcpAppRenderer']; export declare const pluginOnboarding: WebPluginRegistry['pluginOnboarding']; //#endregion export { HOST_SLOTS$1 as HOST_SLOTS, activityGroupSlot$1 as activityGroupSlot }; //# sourceMappingURL=pluginRegistry.d.mts.map