@agimon-ai/po-web-dashboard 0.0.0-alpha.2 → 0.0.0-alpha.21
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.
- package/LICENSE +149 -29
- package/dist/core.cjs +13 -0
- package/dist/core.d.mts +8 -7
- package/dist/core.mjs +7 -6
- package/dist/index.cjs +17 -1
- package/dist/index.d.mts +12 -12
- package/dist/index.mjs +10 -10
- package/dist/types/hub.cjs +9 -100
- package/dist/types/hub.cjs.map +1 -1
- package/dist/types/hub.d.mts +12 -110
- package/dist/types/hub.d.mts.map +1 -1
- package/dist/types/hub.mjs +9 -79
- package/dist/types/hub.mjs.map +1 -1
- package/dist/types/notification.cjs +4 -4
- package/dist/types/notification.cjs.map +1 -1
- package/dist/types/notification.d.mts +5 -5
- package/dist/types/notification.d.mts.map +1 -1
- package/dist/types/notification.mjs +5 -5
- package/dist/types/notification.mjs.map +1 -1
- package/dist/types/settings.cjs.map +1 -1
- package/dist/types/settings.d.mts +1 -1
- package/dist/types/settings.mjs.map +1 -1
- package/dist/types.cjs +2 -23
- package/dist/types.d.mts +3 -3
- package/dist/types.mjs +3 -3
- package/dist/views.cjs +1 -0
- package/dist/views.d.mts +2 -2
- package/dist/views.mjs +2 -2
- package/dist/web/components/SessionMcp.cjs +17 -17
- package/dist/web/components/SessionMcp.cjs.map +1 -1
- package/dist/web/components/SessionMcp.mjs +17 -17
- package/dist/web/components/SessionMcp.mjs.map +1 -1
- package/dist/web/components/Story.fixture.cjs +4 -3
- package/dist/web/components/Story.fixture.cjs.map +1 -1
- package/dist/web/components/Story.fixture.d.mts.map +1 -1
- package/dist/web/components/Story.fixture.mjs +4 -3
- package/dist/web/components/Story.fixture.mjs.map +1 -1
- package/dist/web/components/Template.fixture.cjs +1 -1
- package/dist/web/components/Template.fixture.cjs.map +1 -1
- package/dist/web/components/Template.fixture.mjs +1 -1
- package/dist/web/components/Template.fixture.mjs.map +1 -1
- package/dist/web/components/ToolRendererBoundary.d.mts +1 -0
- package/dist/web/features/activity/ActivityDock.cjs +68 -47
- package/dist/web/features/activity/ActivityDock.cjs.map +1 -1
- package/dist/web/features/activity/ActivityDock.d.mts +2 -1
- package/dist/web/features/activity/ActivityDock.d.mts.map +1 -1
- package/dist/web/features/activity/ActivityDock.mjs +70 -49
- package/dist/web/features/activity/ActivityDock.mjs.map +1 -1
- package/dist/web/features/activity/ContextItemDialog.cjs +17 -17
- package/dist/web/features/activity/ContextItemDialog.cjs.map +1 -1
- package/dist/web/features/activity/ContextItemDialog.d.mts +1 -0
- package/dist/web/features/activity/ContextItemDialog.mjs +17 -17
- package/dist/web/features/activity/ContextItemDialog.mjs.map +1 -1
- package/dist/web/features/activity/ContextPanel.cjs +184 -148
- package/dist/web/features/activity/ContextPanel.cjs.map +1 -1
- package/dist/web/features/activity/ContextPanel.d.mts +23 -0
- package/dist/web/features/activity/ContextPanel.d.mts.map +1 -1
- package/dist/web/features/activity/ContextPanel.mjs +186 -151
- package/dist/web/features/activity/ContextPanel.mjs.map +1 -1
- package/dist/web/features/activity/DockTabs.cjs +1 -1
- package/dist/web/features/activity/DockTabs.cjs.map +1 -1
- package/dist/web/features/activity/DockTabs.mjs +1 -1
- package/dist/web/features/activity/DockTabs.mjs.map +1 -1
- package/dist/web/features/connection/RefusedCard.cjs +9 -9
- package/dist/web/features/connection/RefusedCard.cjs.map +1 -1
- package/dist/web/features/connection/RefusedCard.mjs +9 -9
- package/dist/web/features/connection/RefusedCard.mjs.map +1 -1
- package/dist/web/features/dialogs/DialogOverlay.cjs +9 -9
- package/dist/web/features/dialogs/DialogOverlay.cjs.map +1 -1
- package/dist/web/features/dialogs/DialogOverlay.mjs +9 -9
- package/dist/web/features/dialogs/DialogOverlay.mjs.map +1 -1
- package/dist/web/features/leader/CommandPalette.cjs +23 -23
- package/dist/web/features/leader/CommandPalette.cjs.map +1 -1
- package/dist/web/features/leader/CommandPalette.mjs +23 -23
- package/dist/web/features/leader/CommandPalette.mjs.map +1 -1
- package/dist/web/features/remote/DevProxyTargets.cjs +6 -6
- package/dist/web/features/remote/DevProxyTargets.cjs.map +1 -1
- package/dist/web/features/remote/DevProxyTargets.mjs +6 -6
- package/dist/web/features/remote/DevProxyTargets.mjs.map +1 -1
- package/dist/web/features/remote/HandoverProgress.cjs +2 -2
- package/dist/web/features/remote/HandoverProgress.cjs.map +1 -1
- package/dist/web/features/remote/HandoverProgress.mjs +2 -2
- package/dist/web/features/remote/HandoverProgress.mjs.map +1 -1
- package/dist/web/features/remote/PairedDeviceList.cjs +3 -3
- package/dist/web/features/remote/PairedDeviceList.cjs.map +1 -1
- package/dist/web/features/remote/PairedDeviceList.mjs +3 -3
- package/dist/web/features/remote/PairedDeviceList.mjs.map +1 -1
- package/dist/web/features/remote/PairingApprovalDialog.cjs +3 -3
- package/dist/web/features/remote/PairingApprovalDialog.cjs.map +1 -1
- package/dist/web/features/remote/PairingApprovalDialog.mjs +3 -3
- package/dist/web/features/remote/PairingApprovalDialog.mjs.map +1 -1
- package/dist/web/features/remote/RemoteAccessDialog.cjs +3 -3
- package/dist/web/features/remote/RemoteAccessDialog.cjs.map +1 -1
- package/dist/web/features/remote/RemoteAccessDialog.mjs +3 -3
- package/dist/web/features/remote/RemoteAccessDialog.mjs.map +1 -1
- package/dist/web/features/remote/RemoteAccessOptions.cjs +11 -11
- package/dist/web/features/remote/RemoteAccessOptions.cjs.map +1 -1
- package/dist/web/features/remote/RemoteAccessOptions.mjs +11 -11
- package/dist/web/features/remote/RemoteAccessOptions.mjs.map +1 -1
- package/dist/web/features/remote/RemoteAccessPairing.cjs +8 -8
- package/dist/web/features/remote/RemoteAccessPairing.cjs.map +1 -1
- package/dist/web/features/remote/RemoteAccessPairing.mjs +8 -8
- package/dist/web/features/remote/RemoteAccessPairing.mjs.map +1 -1
- package/dist/web/features/remote/SandboxWorkspaces.cjs +3 -3
- package/dist/web/features/remote/SandboxWorkspaces.cjs.map +1 -1
- package/dist/web/features/remote/SandboxWorkspaces.mjs +3 -3
- package/dist/web/features/remote/SandboxWorkspaces.mjs.map +1 -1
- package/dist/web/features/remote/TrustedDeviceList.cjs +4 -4
- package/dist/web/features/remote/TrustedDeviceList.cjs.map +1 -1
- package/dist/web/features/remote/TrustedDeviceList.mjs +4 -4
- package/dist/web/features/remote/TrustedDeviceList.mjs.map +1 -1
- package/dist/web/features/selection/SelectionBar.cjs +40 -37
- package/dist/web/features/selection/SelectionBar.cjs.map +1 -1
- package/dist/web/features/selection/SelectionBar.d.mts.map +1 -1
- package/dist/web/features/selection/SelectionBar.mjs +41 -38
- package/dist/web/features/selection/SelectionBar.mjs.map +1 -1
- package/dist/web/features/session/AgentLockPanel.cjs +3 -3
- package/dist/web/features/session/AgentLockPanel.cjs.map +1 -1
- package/dist/web/features/session/AgentLockPanel.mjs +3 -3
- package/dist/web/features/session/AgentLockPanel.mjs.map +1 -1
- package/dist/web/features/session/Composer.cjs +11 -11
- package/dist/web/features/session/Composer.cjs.map +1 -1
- package/dist/web/features/session/Composer.mjs +11 -11
- package/dist/web/features/session/Composer.mjs.map +1 -1
- package/dist/web/features/session/DormantPanel.cjs +4 -4
- package/dist/web/features/session/DormantPanel.cjs.map +1 -1
- package/dist/web/features/session/DormantPanel.mjs +4 -4
- package/dist/web/features/session/DormantPanel.mjs.map +1 -1
- package/dist/web/features/session/MentionPreviews.cjs +10 -10
- package/dist/web/features/session/MentionPreviews.cjs.map +1 -1
- package/dist/web/features/session/MentionPreviews.mjs +10 -10
- package/dist/web/features/session/MentionPreviews.mjs.map +1 -1
- package/dist/web/features/session/QueueSheet.cjs +28 -35
- package/dist/web/features/session/QueueSheet.cjs.map +1 -1
- package/dist/web/features/session/QueueSheet.mjs +28 -35
- package/dist/web/features/session/QueueSheet.mjs.map +1 -1
- package/dist/web/features/session/SessionActivity.cjs +8 -4
- package/dist/web/features/session/SessionActivity.cjs.map +1 -1
- package/dist/web/features/session/SessionActivity.d.mts +1 -1
- package/dist/web/features/session/SessionActivity.d.mts.map +1 -1
- package/dist/web/features/session/SessionActivity.mjs +8 -4
- package/dist/web/features/session/SessionActivity.mjs.map +1 -1
- package/dist/web/features/session/ThreadView.cjs +1 -0
- package/dist/web/features/session/ThreadView.cjs.map +1 -1
- package/dist/web/features/session/ThreadView.mjs +1 -0
- package/dist/web/features/session/ThreadView.mjs.map +1 -1
- package/dist/web/features/session/Timeline.cjs +173 -69
- package/dist/web/features/session/Timeline.cjs.map +1 -1
- package/dist/web/features/session/Timeline.d.mts +3 -1
- package/dist/web/features/session/Timeline.d.mts.map +1 -1
- package/dist/web/features/session/Timeline.mjs +174 -70
- package/dist/web/features/session/Timeline.mjs.map +1 -1
- package/dist/web/features/session/ToolCard.cjs +6 -6
- package/dist/web/features/session/ToolCard.cjs.map +1 -1
- package/dist/web/features/session/ToolCard.mjs +6 -6
- package/dist/web/features/session/ToolCard.mjs.map +1 -1
- package/dist/web/features/sessions/NewSessionDialog.cjs +3 -3
- package/dist/web/features/sessions/NewSessionDialog.cjs.map +1 -1
- package/dist/web/features/sessions/NewSessionDialog.mjs +3 -3
- package/dist/web/features/sessions/NewSessionDialog.mjs.map +1 -1
- package/dist/web/features/sessions/ResumeSessionDialog.cjs +11 -8
- package/dist/web/features/sessions/ResumeSessionDialog.cjs.map +1 -1
- package/dist/web/features/sessions/ResumeSessionDialog.d.mts +1 -0
- package/dist/web/features/sessions/ResumeSessionDialog.mjs +11 -8
- package/dist/web/features/sessions/ResumeSessionDialog.mjs.map +1 -1
- package/dist/web/features/sessions/WelcomePanel.cjs +29 -15
- package/dist/web/features/sessions/WelcomePanel.cjs.map +1 -1
- package/dist/web/features/sessions/WelcomePanel.d.mts +3 -0
- package/dist/web/features/sessions/WelcomePanel.d.mts.map +1 -1
- package/dist/web/features/sessions/WelcomePanel.mjs +29 -15
- package/dist/web/features/sessions/WelcomePanel.mjs.map +1 -1
- package/dist/web/features/sessions/useSessionRail.cjs +14 -16
- package/dist/web/features/sessions/useSessionRail.cjs.map +1 -1
- package/dist/web/features/sessions/useSessionRail.d.mts.map +1 -1
- package/dist/web/features/sessions/useSessionRail.mjs +16 -18
- package/dist/web/features/sessions/useSessionRail.mjs.map +1 -1
- package/dist/web/features/settings/AppearanceSettings.cjs +3 -3
- package/dist/web/features/settings/AppearanceSettings.cjs.map +1 -1
- package/dist/web/features/settings/AppearanceSettings.mjs +3 -3
- package/dist/web/features/settings/AppearanceSettings.mjs.map +1 -1
- package/dist/web/features/settings/ContributedSettings.cjs +9 -9
- package/dist/web/features/settings/ContributedSettings.cjs.map +1 -1
- package/dist/web/features/settings/ContributedSettings.d.mts +1 -0
- package/dist/web/features/settings/ContributedSettings.mjs +9 -9
- package/dist/web/features/settings/ContributedSettings.mjs.map +1 -1
- package/dist/web/features/settings/ImageSettings.cjs +2 -2
- package/dist/web/features/settings/ImageSettings.cjs.map +1 -1
- package/dist/web/features/settings/ImageSettings.d.mts +1 -1
- package/dist/web/features/settings/ImageSettings.mjs +2 -2
- package/dist/web/features/settings/ImageSettings.mjs.map +1 -1
- package/dist/web/features/settings/LoginFlowDialog.cjs +18 -18
- package/dist/web/features/settings/LoginFlowDialog.cjs.map +1 -1
- package/dist/web/features/settings/LoginFlowDialog.mjs +18 -18
- package/dist/web/features/settings/LoginFlowDialog.mjs.map +1 -1
- package/dist/web/features/settings/PluginSettings.cjs +1 -1
- package/dist/web/features/settings/PluginSettings.cjs.map +1 -1
- package/dist/web/features/settings/PluginSettings.mjs +1 -1
- package/dist/web/features/settings/PluginSettings.mjs.map +1 -1
- package/dist/web/features/settings/ProviderSettings.cjs +18 -18
- package/dist/web/features/settings/ProviderSettings.cjs.map +1 -1
- package/dist/web/features/settings/ProviderSettings.mjs +18 -18
- package/dist/web/features/settings/ProviderSettings.mjs.map +1 -1
- package/dist/web/features/settings/RepositorySettings.cjs +6 -6
- package/dist/web/features/settings/RepositorySettings.cjs.map +1 -1
- package/dist/web/features/settings/RepositorySettings.mjs +6 -6
- package/dist/web/features/settings/RepositorySettings.mjs.map +1 -1
- package/dist/web/features/settings/RepositoryWorkspace.cjs +3 -3
- package/dist/web/features/settings/RepositoryWorkspace.cjs.map +1 -1
- package/dist/web/features/settings/RepositoryWorkspace.mjs +3 -3
- package/dist/web/features/settings/RepositoryWorkspace.mjs.map +1 -1
- package/dist/web/features/settings/SessionMcpSettings.cjs +14 -14
- package/dist/web/features/settings/SessionMcpSettings.cjs.map +1 -1
- package/dist/web/features/settings/SessionMcpSettings.mjs +14 -14
- package/dist/web/features/settings/SessionMcpSettings.mjs.map +1 -1
- package/dist/web/features/settings/SettingsMenu.cjs +8 -8
- package/dist/web/features/settings/SettingsMenu.cjs.map +1 -1
- package/dist/web/features/settings/SettingsMenu.mjs +8 -8
- package/dist/web/features/settings/SettingsMenu.mjs.map +1 -1
- package/dist/web/features/settings/SettingsPanelHost.d.mts +1 -0
- package/dist/web/features/settings/TemplateSettings.cjs +8 -8
- package/dist/web/features/settings/TemplateSettings.cjs.map +1 -1
- package/dist/web/features/settings/TemplateSettings.mjs +8 -8
- package/dist/web/features/settings/TemplateSettings.mjs.map +1 -1
- package/dist/web/features/settings/TunnelSettings.cjs +6 -6
- package/dist/web/features/settings/TunnelSettings.cjs.map +1 -1
- package/dist/web/features/settings/TunnelSettings.mjs +6 -6
- package/dist/web/features/settings/TunnelSettings.mjs.map +1 -1
- package/dist/web/features/status/TopBar.cjs +6 -6
- package/dist/web/features/status/TopBar.cjs.map +1 -1
- package/dist/web/features/status/TopBar.mjs +6 -6
- package/dist/web/features/status/TopBar.mjs.map +1 -1
- package/dist/web/lib/browserNotifications.cjs.map +1 -1
- package/dist/web/lib/browserNotifications.d.mts +2 -2
- package/dist/web/lib/browserNotifications.d.mts.map +1 -1
- package/dist/web/lib/browserNotifications.mjs.map +1 -1
- package/dist/web/lib/browserTelemetry.cjs.map +1 -1
- package/dist/web/lib/browserTelemetry.d.mts +2 -1
- package/dist/web/lib/browserTelemetry.d.mts.map +1 -1
- package/dist/web/lib/browserTelemetry.mjs.map +1 -1
- package/dist/web/lib/commands.d.mts +1 -0
- package/dist/web/lib/composerSubmissions.d.mts +1 -0
- package/dist/web/lib/composition.cjs +21 -5
- package/dist/web/lib/composition.cjs.map +1 -1
- package/dist/web/lib/composition.d.mts +15 -0
- package/dist/web/lib/composition.d.mts.map +1 -1
- package/dist/web/lib/composition.mjs +21 -6
- package/dist/web/lib/composition.mjs.map +1 -1
- package/dist/web/lib/contextComposition.cjs +1 -1
- package/dist/web/lib/contextComposition.cjs.map +1 -1
- package/dist/web/lib/contextComposition.mjs +1 -1
- package/dist/web/lib/contextComposition.mjs.map +1 -1
- package/dist/web/lib/dashboardRoute.d.mts +1 -0
- package/dist/web/lib/hubApi.cjs +62 -1
- package/dist/web/lib/hubApi.cjs.map +1 -1
- package/dist/web/lib/hubApi.d.mts +19 -0
- package/dist/web/lib/hubApi.d.mts.map +1 -1
- package/dist/web/lib/hubApi.mjs +59 -3
- package/dist/web/lib/hubApi.mjs.map +1 -1
- package/dist/web/lib/modelContextAdapter.d.mts +1 -0
- package/dist/web/lib/piTransport.cjs +34 -53
- package/dist/web/lib/piTransport.cjs.map +1 -1
- package/dist/web/lib/piTransport.d.mts +3 -3
- package/dist/web/lib/piTransport.d.mts.map +1 -1
- package/dist/web/lib/piTransport.mjs +34 -53
- package/dist/web/lib/piTransport.mjs.map +1 -1
- package/dist/web/lib/pluginRegistry.cjs +53 -4
- package/dist/web/lib/pluginRegistry.cjs.map +1 -1
- package/dist/web/lib/pluginRegistry.d.mts +15 -1
- package/dist/web/lib/pluginRegistry.d.mts.map +1 -1
- package/dist/web/lib/pluginRegistry.mjs +53 -5
- package/dist/web/lib/pluginRegistry.mjs.map +1 -1
- package/dist/web/lib/protocolHubSocket.cjs +151 -89
- package/dist/web/lib/protocolHubSocket.cjs.map +1 -1
- package/dist/web/lib/protocolHubSocket.d.mts +21 -6
- package/dist/web/lib/protocolHubSocket.d.mts.map +1 -1
- package/dist/web/lib/protocolHubSocket.mjs +152 -90
- package/dist/web/lib/protocolHubSocket.mjs.map +1 -1
- package/dist/web/lib/sessionActivityRenderer.d.mts +1 -0
- package/dist/web/lib/sessionModel.cjs +120 -20
- package/dist/web/lib/sessionModel.cjs.map +1 -1
- package/dist/web/lib/sessionModel.d.mts +32 -2
- package/dist/web/lib/sessionModel.d.mts.map +1 -1
- package/dist/web/lib/sessionModel.mjs +120 -22
- package/dist/web/lib/sessionModel.mjs.map +1 -1
- package/dist/web/lib/sessionProtocolCommands.cjs +33 -34
- package/dist/web/lib/sessionProtocolCommands.cjs.map +1 -1
- package/dist/web/lib/sessionProtocolCommands.d.mts +3 -2
- package/dist/web/lib/sessionProtocolCommands.d.mts.map +1 -1
- package/dist/web/lib/sessionProtocolCommands.mjs +33 -34
- package/dist/web/lib/sessionProtocolCommands.mjs.map +1 -1
- package/dist/web/lib/sessionRailModel.cjs +2 -1
- package/dist/web/lib/sessionRailModel.cjs.map +1 -1
- package/dist/web/lib/sessionRailModel.d.mts +1 -1
- package/dist/web/lib/sessionRailModel.d.mts.map +1 -1
- package/dist/web/lib/sessionRailModel.mjs +2 -1
- package/dist/web/lib/sessionRailModel.mjs.map +1 -1
- package/dist/web/lib/sessionSelectionApi.cjs +72 -0
- package/dist/web/lib/sessionSelectionApi.cjs.map +1 -0
- package/dist/web/lib/sessionSelectionApi.d.mts +18 -0
- package/dist/web/lib/sessionSelectionApi.d.mts.map +1 -0
- package/dist/web/lib/sessionSelectionApi.mjs +72 -0
- package/dist/web/lib/sessionSelectionApi.mjs.map +1 -0
- package/dist/web/lib/sessionSummary.cjs +1 -0
- package/dist/web/lib/sessionSummary.cjs.map +1 -1
- package/dist/web/lib/sessionSummary.d.mts +1 -1
- package/dist/web/lib/sessionSummary.d.mts.map +1 -1
- package/dist/web/lib/sessionSummary.mjs +1 -0
- package/dist/web/lib/sessionSummary.mjs.map +1 -1
- package/dist/web/lib/sessionTranscriptRenderer.d.mts +1 -0
- package/dist/web/lib/statusLine.d.mts +1 -0
- package/dist/web/lib/stepUp.d.mts.map +1 -1
- package/dist/web/lib/threadRenderer.d.mts +1 -0
- package/dist/web/lib/toolCompletionTabs.d.mts +1 -0
- package/dist/web/lib/transport.cjs +10 -2
- package/dist/web/lib/transport.cjs.map +1 -1
- package/dist/web/lib/transport.d.mts +6 -2
- package/dist/web/lib/transport.d.mts.map +1 -1
- package/dist/web/lib/transport.mjs +10 -3
- package/dist/web/lib/transport.mjs.map +1 -1
- package/dist/web/stores/captureStore.cjs +22 -4
- package/dist/web/stores/captureStore.cjs.map +1 -1
- package/dist/web/stores/captureStore.d.mts.map +1 -1
- package/dist/web/stores/captureStore.mjs +22 -4
- package/dist/web/stores/captureStore.mjs.map +1 -1
- package/dist/web/stores/fileLinkModesStore.cjs +27 -10
- package/dist/web/stores/fileLinkModesStore.cjs.map +1 -1
- package/dist/web/stores/fileLinkModesStore.d.mts +5 -0
- package/dist/web/stores/fileLinkModesStore.d.mts.map +1 -1
- package/dist/web/stores/fileLinkModesStore.mjs +28 -12
- package/dist/web/stores/fileLinkModesStore.mjs.map +1 -1
- package/dist/web/stores/pagedTranscriptStore.cjs +29 -37
- package/dist/web/stores/pagedTranscriptStore.cjs.map +1 -1
- package/dist/web/stores/pagedTranscriptStore.d.mts.map +1 -1
- package/dist/web/stores/pagedTranscriptStore.mjs +30 -38
- package/dist/web/stores/pagedTranscriptStore.mjs.map +1 -1
- package/dist/web/stores/sessionStore.cjs +81 -3
- package/dist/web/stores/sessionStore.cjs.map +1 -1
- package/dist/web/stores/sessionStore.d.mts +13 -2
- package/dist/web/stores/sessionStore.d.mts.map +1 -1
- package/dist/web/stores/sessionStore.mjs +80 -5
- package/dist/web/stores/sessionStore.mjs.map +1 -1
- package/dist/web/stores/sessionsStore.cjs +37 -5
- package/dist/web/stores/sessionsStore.cjs.map +1 -1
- package/dist/web/stores/sessionsStore.d.mts +10 -0
- package/dist/web/stores/sessionsStore.d.mts.map +1 -1
- package/dist/web/stores/sessionsStore.mjs +36 -6
- package/dist/web/stores/sessionsStore.mjs.map +1 -1
- package/dist/web/stores/templateStore.cjs +1 -1
- package/dist/web/stores/templateStore.cjs.map +1 -1
- package/dist/web/stores/templateStore.d.mts +1 -1
- package/dist/web/stores/templateStore.mjs +1 -1
- package/dist/web/stores/templateStore.mjs.map +1 -1
- package/dist/web/stores/threadStore.cjs +12 -9
- package/dist/web/stores/threadStore.cjs.map +1 -1
- package/dist/web/stores/threadStore.d.mts +7 -3
- package/dist/web/stores/threadStore.d.mts.map +1 -1
- package/dist/web/stores/threadStore.mjs +13 -10
- package/dist/web/stores/threadStore.mjs.map +1 -1
- package/dist/web/stores/transientTabsStore.d.mts +1 -0
- package/dist/web/stores/useToolPrompt.cjs +18 -9
- package/dist/web/stores/useToolPrompt.cjs.map +1 -1
- package/dist/web/stores/useToolPrompt.d.mts +3 -2
- package/dist/web/stores/useToolPrompt.d.mts.map +1 -1
- package/dist/web/stores/useToolPrompt.mjs +18 -9
- package/dist/web/stores/useToolPrompt.mjs.map +1 -1
- package/package.json +13 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pluginRegistry.cjs","names":["collectWebTemplates","mergeScopedPlugins","collectNativeTemplates","pluginsAtScope","leaderConflicts"],"sources":["../../../src/web/lib/pluginRegistry.ts"],"sourcesContent":["import type {\n ActivityGroupContribution,\n ContextActionContribution,\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 type { ComponentType } from 'react';\n\nimport { leaderConflicts } from './leaderTree';\nimport { mergeScopedPlugins, pluginsAtScope } from './pluginScopes';\nimport {\n collectNativeTemplates,\n collectWebTemplates,\n type NativeTemplateCatalog,\n type WebTemplateCatalog,\n} from './templateCatalog';\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 | 'invalid-template'\n | 'duplicate-template'\n | 'slot-load-failed';\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 InstalledContextAction extends ContextActionContribution {\n pluginId: string;\n}\n\nexport interface InstalledUserMessageAction extends UserMessageActionContribution {\n pluginId: string;\n}\n/** The slots the host itself declares; a plugin's own slots are namespaced by its id instead. */\nexport const HOST_SLOTS = {\n overlay: 'overlay',\n rail: 'rail',\n context: 'context',\n selectionBar: 'selection-bar',\n activity: 'activity',\n composerActions: 'composer-actions',\n composerMenu: 'composer-menu',\n sessionMenu: 'session-menu',\n /** A workspace plugin fill here replaces the host's new-session dialog for that workspace. */\n newSession: 'new-session',\n} as const;\n\nconst SLOT_SEPARATOR = '.';\nconst DEFAULT_FILL_ORDER = 1000;\nconst RESERVED_PLUGIN_IDS: ReadonlySet<string> = new Set(Object.values(HOST_SLOTS));\n\n/** The keyed slot an activity group opens: sections fill it and render as the group's body. */\nexport function activityGroupSlot(name: string): string {\n return `${HOST_SLOTS.activity}${SLOT_SEPARATOR}${name}`;\n}\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\nlet defaultState = emptyState();\nlet installingState = defaultState;\nlet defaultInstalled = false;\nconst sessionStates = new Map<string, RegistryState>();\nconst workspaceStates = new Map<string, RegistryState>();\nconst sessionPlugins = new Map<string, readonly WebPluginDefinition[]>();\nconst sessionWorkspaces = new Map<string, string>();\nlet activeWorkspaceId: string | null = null;\nconst pendingSessionFrames = new Map<string, Map<string, Record<string, unknown>>>();\nconst MAX_PENDING_CHANNEL_TYPES = 64;\nlet activeSessionId: string | null = null;\n/** Slots each mount could not load, keyed `global`, `workspace:<id>` or `session:<id>`. */\nconst loadDiagnostics = new Map<string, readonly InstallDiagnostic[]>();\nlet registryRevision = 0;\nconst registryListeners = new Set<() => void>();\n\nfunction 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\nfunction 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. */\nexport function webTemplateCatalog(mount?: WebPluginMount): WebTemplateCatalog {\n if (mount === undefined) {\n const scope = activeSessionId === null ? (activeWorkspaceId === null ? 'global' : 'workspace') : 'session';\n return collectWebTemplates(activeState().plugins, scope);\n }\n if (mount.scope === 'global') return collectWebTemplates(defaultState.plugins, 'global');\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. */\nexport function nativeTemplateCatalog(mount: WebPluginMount): NativeTemplateCatalog {\n if (mount.scope === 'global') return collectNativeTemplates(defaultState.plugins, 'global');\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}\nfunction 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 = buildWebPluginState(\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\nexport function installGlobalWebPlugins(plugins: readonly WebPluginDefinition[]): void {\n defaultState = buildWebPluginState(pluginsAtScope(plugins, 'global'));\n for (const id of sessionPlugins.keys()) rebuildSession(id);\n emitRegistryChange();\n}\n\nexport function installWorkspaceWebPlugins(workspaceId: string, plugins: readonly WebPluginDefinition[]): void {\n const state = buildWebPluginState(pluginsAtScope(plugins, 'workspace'));\n workspaceStates.set(workspaceId, state);\n for (const [id, owner] of sessionWorkspaces) if (owner === workspaceId) rebuildSession(id);\n emitRegistryChange();\n}\n\nexport 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\nexport function activateWebPluginWorkspace(workspaceId: string | null): void {\n if (activeWorkspaceId === workspaceId) return;\n activeWorkspaceId = workspaceId;\n emitRegistryChange();\n}\n\nexport function bindSessionWebWorkspace(sessionId: string, workspaceId: string): void {\n sessionWorkspaces.set(sessionId, workspaceId);\n if (sessionPlugins.has(sessionId)) rebuildSession(sessionId);\n}\n\nfunction 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. */\nconst LEADER_KEY = /^[a-z0-9]$/;\nconst 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 */\nfunction 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\ninterface PendingFill {\n pluginId: string;\n fill: SlotFillContribution;\n}\n\ninterface PendingSection {\n pluginId: string;\n section: SurfaceContribution;\n}\n\ninterface PendingBinding {\n pluginId: string;\n binding: LeaderBindingContribution;\n}\n\ntype 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 */\nfunction 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\nfunction surfaceFill(slot: string, surface: SurfaceContribution): SlotFillContribution {\n return { slot, id: surface.id, component: surface.component };\n}\n\nfunction 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\nfunction 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(`Web plugin '${pluginId}' fill '${fill.id}' into '${fill.slot}' has neither a component nor data.`);\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\nfunction 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\nfunction checkUserMessageAction(pluginId: string, seen: Set<string>, action: UserMessageActionContribution): void {\n if (action.id.trim() === '') 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\nconst byFillOrder = (left: ResolvedFill, right: ResolvedFill): number =>\n left.order - right.order || left.pluginId.localeCompare(right.pluginId) || left.id.localeCompare(right.id);\n\nconst 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\nfunction 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\nfunction 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\nfunction buildWebPluginState(plugins: readonly WebPluginDefinition[]): 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 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) placeFill(pluginId, fill);\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\nexport function installWebPlugins(plugins: readonly WebPluginDefinition[]): void {\n if (defaultInstalled) throw new Error('Web plugins are already installed.');\n defaultState = buildWebPluginState(plugins);\n installingState = defaultState;\n defaultInstalled = true;\n}\n\nexport function webPluginsInstalled(): boolean {\n return defaultInstalled;\n}\n\n/** Unit-test escape hatch; production installs exactly once. */\nexport function resetWebPlugins(): void {\n defaultState = emptyState();\n installingState = defaultState;\n defaultInstalled = false;\n sessionStates.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. */\nexport 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. */\nexport 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. */\nexport 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\nexport function subscribeWebPluginRegistry(listener: () => void): () => void {\n registryListeners.add(listener);\n return () => registryListeners.delete(listener);\n}\n\nexport 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 */\nexport function setWebPluginLoadDiagnostics(mount: WebPluginMount, diagnostics: readonly InstallDiagnostic[]): void {\n const key =\n mount.scope === 'global'\n ? 'global'\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 */\nexport function webPluginDiagnostics(): readonly InstallDiagnostic[] {\n const workspaceId =\n (activeSessionId === null ? undefined : sessionWorkspaces.get(activeSessionId)) ?? activeWorkspaceId;\n const failed = [\n 'global',\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. */\nexport function installedWebPlugins(): readonly WebPluginDefinition[] {\n return activeState().plugins;\n}\n\nexport interface InstalledRepositorySettingsPanel extends RepositorySettingsPanelContribution {\n pluginId: string;\n}\n\n/** Package panels placed under the host's repository controls, in stable display order. */\nexport function pluginRepositorySettingsPanels(): readonly InstalledRepositorySettingsPanel[] {\n return (workspaceState() ?? emptyState()).plugins\n .flatMap((plugin) =>\n plugin.repositorySettingsPanel === undefined ? [] : [{ 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\nexport 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. */\nexport 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. */\nexport 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 */\nexport function pluginSettingsSections(\n scope: 'global' | 'workspace' = 'global',\n): readonly SettingsSectionContribution[] {\n const sections = (scope === 'global' ? defaultState : workspaceState())?.settingsSections ?? [];\n return isDesktopClient() ? sections : sections.filter((section) => !section.desktopOnly);\n}\n\nexport interface InstalledSettingsPanel extends SettingsPanelContribution {\n pluginId: string;\n}\n\n/** The settings pages plugins draw themselves, in install order; the reader sorts them with the sections. */\nexport 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. */\nexport 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. */\nexport function workspaceSlotFills(workspaceId: string, slot: string): readonly ResolvedFill[] {\n return workspaceStates.get(workspaceId)?.fills.get(slot) ?? [];\n}\n\nexport function paletteCommands(): readonly PaletteCommandContribution[] {\n return activeState().commands;\n}\n\n/** Context actions from every installed plugin, in stable display order. */\nexport 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. */\nexport 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. */\nexport function pluginLeaderBindings(): readonly LeaderBindingContribution[] {\n return activeState().leaderBindings;\n}\n\n/** Selection-axis declarations from every installed plugin, in display order. */\nexport function pluginSelectionAxes(): readonly SelectionAxisContribution[] {\n return activeState().selectionAxes;\n}\n\n/** Minor-mode declarations from every installed plugin, in display order. */\nexport function pluginMinorModes(): readonly MinorModeContribution[] {\n return activeState().minorModes;\n}\n\n/** Activity-dock group declarations from every installed plugin, in display order. */\nexport function pluginActivityGroups(): readonly ActivityGroupContribution[] {\n const groups = activeState().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 */\nexport 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 */\nexport 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\nfunction 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 */\nexport 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\nexport function sessionWebPluginsInstalled(sessionId: string): boolean {\n return sessionStates.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 */\nfunction 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\nexport 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. */\nexport 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/** Starts every plugin runtime in install order; the disposer runs in reverse. */\nexport function startPluginDefinitions(plugins: readonly WebPluginDefinition[], runtime: WebPluginRuntime): () => void {\n const disposers: Array<() => void> = [];\n const disposeStarted = (): void => {\n for (const dispose of disposers.reverse()) dispose();\n };\n try {\n for (const plugin of plugins) {\n const dispose = plugin.start?.(runtime);\n if (dispose) disposers.push(dispose);\n }\n } catch (error) {\n disposeStarted();\n throw error;\n }\n return disposeStarted;\n}\n\nexport function startWebPlugins(runtime: WebPluginRuntime): () => void {\n return startPluginDefinitions(activeState().plugins, runtime);\n}\n"],"mappings":";;;;;AAiGA,MAAa,aAAa;CACxB,SAAS;CACT,MAAM;CACN,SAAS;CACT,cAAc;CACd,UAAU;CACV,iBAAiB;CACjB,cAAc;CACd,aAAa;;CAEb,YAAY;AACd;AAEA,MAAM,iBAAiB;AACvB,MAAM,qBAAqB;AAC3B,MAAM,sBAA2C,IAAI,IAAI,OAAO,OAAO,UAAU,CAAC;;AAGlF,SAAgB,kBAAkB,MAAsB;CACtD,OAAO,GAAG,WAAW,WAAW,iBAAiB;AACnD;AAwBA,SAAS,aAA4B;CACnC,OAAO;EACL,SAAS,CAAC;EACV,MAAM,CAAC;EACP,W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AAC9D"}
|
|
1
|
+
{"version":3,"file":"pluginRegistry.cjs","names":["collectWebTemplates","mergeScopedPlugins","collectNativeTemplates","pluginsAtScope","leaderConflicts","parseHomeContribution"],"sources":["../../../src/web/lib/pluginRegistry.ts"],"sourcesContent":["import type {\n ActivityGroupContribution,\n ContextActionContribution,\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 { parseHomeContribution, type HomeContribution } from '@agimon-ai/po-core/web';\nimport type { ComponentType } from 'react';\n\nimport { leaderConflicts } from './leaderTree';\nimport { mergeScopedPlugins, pluginsAtScope } from './pluginScopes';\nimport {\n collectNativeTemplates,\n collectWebTemplates,\n type NativeTemplateCatalog,\n type WebTemplateCatalog,\n} from './templateCatalog';\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 | 'invalid-template'\n | 'duplicate-template'\n | 'slot-load-failed';\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 InstalledContextAction extends ContextActionContribution {\n pluginId: string;\n}\n\nexport interface InstalledUserMessageAction extends UserMessageActionContribution {\n pluginId: string;\n}\n/** The slots the host itself declares; a plugin's own slots are namespaced by its id instead. */\nexport const HOST_SLOTS = {\n home: 'home',\n overlay: 'overlay',\n rail: 'rail',\n context: 'context',\n selectionBar: 'selection-bar',\n activity: 'activity',\n composerActions: 'composer-actions',\n composerMenu: 'composer-menu',\n sessionMenu: 'session-menu',\n /** A workspace plugin fill here replaces the host's new-session dialog for that workspace. */\n newSession: 'new-session',\n} as const;\n\nconst SLOT_SEPARATOR = '.';\nconst DEFAULT_FILL_ORDER = 1000;\nconst RESERVED_PLUGIN_IDS: ReadonlySet<string> = new Set(Object.values(HOST_SLOTS));\n\n/** The keyed slot an activity group opens: sections fill it and render as the group's body. */\nexport function activityGroupSlot(name: string): string {\n return `${HOST_SLOTS.activity}${SLOT_SEPARATOR}${name}`;\n}\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\nlet defaultState = emptyState();\nlet installingState = defaultState;\nlet defaultInstalled = false;\nconst sessionStates = new Map<string, RegistryState>();\nconst workspaceStates = new Map<string, RegistryState>();\nconst sessionPlugins = new Map<string, readonly WebPluginDefinition[]>();\nconst sessionWorkspaces = new Map<string, string>();\nlet activeWorkspaceId: string | null = null;\nconst pendingSessionFrames = new Map<string, Map<string, Record<string, unknown>>>();\nconst MAX_PENDING_CHANNEL_TYPES = 64;\nlet activeSessionId: string | null = null;\n/** Slots each mount could not load, keyed `global`, `workspace:<id>` or `session:<id>`. */\nconst loadDiagnostics = new Map<string, readonly InstallDiagnostic[]>();\nlet registryRevision = 0;\nconst registryListeners = new Set<() => void>();\n\nfunction 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\nfunction 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. */\nexport function webTemplateCatalog(mount?: WebPluginMount): WebTemplateCatalog {\n if (mount === undefined) {\n const scope = activeSessionId === null ? (activeWorkspaceId === null ? 'global' : 'workspace') : 'session';\n return collectWebTemplates(activeState().plugins, scope);\n }\n if (mount.scope === 'global') return collectWebTemplates(defaultState.plugins, 'global');\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. */\nexport function nativeTemplateCatalog(mount: WebPluginMount): NativeTemplateCatalog {\n if (mount.scope === 'global') return collectNativeTemplates(defaultState.plugins, 'global');\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}\nfunction 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 = buildWebPluginState(\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\nexport function installGlobalWebPlugins(plugins: readonly WebPluginDefinition[]): void {\n defaultState = buildWebPluginState(pluginsAtScope(plugins, 'global'), plugins);\n for (const id of sessionPlugins.keys()) rebuildSession(id);\n emitRegistryChange();\n}\n\nexport function installWorkspaceWebPlugins(workspaceId: string, plugins: readonly WebPluginDefinition[]): void {\n const state = buildWebPluginState(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\nexport 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\nexport function activateWebPluginWorkspace(workspaceId: string | null): void {\n if (activeWorkspaceId === workspaceId) return;\n activeWorkspaceId = workspaceId;\n emitRegistryChange();\n}\n\nexport function bindSessionWebWorkspace(sessionId: string, workspaceId: string): void {\n sessionWorkspaces.set(sessionId, workspaceId);\n if (sessionPlugins.has(sessionId)) rebuildSession(sessionId);\n}\n\nfunction 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. */\nconst LEADER_KEY = /^[a-z0-9]$/;\nconst 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 */\nfunction 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\ninterface PendingFill {\n pluginId: string;\n fill: SlotFillContribution;\n}\n\ninterface PendingSection {\n pluginId: string;\n section: SurfaceContribution;\n}\n\ninterface PendingBinding {\n pluginId: string;\n binding: LeaderBindingContribution;\n}\n\ntype 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 */\nfunction 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\nfunction surfaceFill(slot: string, surface: SurfaceContribution): SlotFillContribution {\n return { slot, id: surface.id, component: surface.component };\n}\n\nfunction 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\nfunction 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(`Web plugin '${pluginId}' fill '${fill.id}' into '${fill.slot}' has neither a component nor data.`);\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\nfunction 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\nfunction checkUserMessageAction(pluginId: string, seen: Set<string>, action: UserMessageActionContribution): void {\n if (action.id.trim() === '') 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\nconst byFillOrder = (left: ResolvedFill, right: ResolvedFill): number =>\n left.order - right.order || left.pluginId.localeCompare(right.pluginId) || left.id.localeCompare(right.id);\n\nconst 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\nfunction 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\nfunction 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\nfunction 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 (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?.global, 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\nexport function installWebPlugins(plugins: readonly WebPluginDefinition[]): void {\n if (defaultInstalled) throw new Error('Web plugins are already installed.');\n defaultState = buildWebPluginState(plugins);\n installingState = defaultState;\n defaultInstalled = true;\n}\n\nexport function webPluginsInstalled(): boolean {\n return defaultInstalled;\n}\n\n/** Unit-test escape hatch; production installs exactly once. */\nexport function resetWebPlugins(): void {\n defaultState = emptyState();\n installingState = defaultState;\n defaultInstalled = false;\n sessionStates.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. */\nexport 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. */\nexport 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. */\nexport 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\nexport function subscribeWebPluginRegistry(listener: () => void): () => void {\n registryListeners.add(listener);\n return () => registryListeners.delete(listener);\n}\n\nexport 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 */\nexport function setWebPluginLoadDiagnostics(mount: WebPluginMount, diagnostics: readonly InstallDiagnostic[]): void {\n const key =\n mount.scope === 'global'\n ? 'global'\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 */\nexport function webPluginDiagnostics(): readonly InstallDiagnostic[] {\n const workspaceId =\n (activeSessionId === null ? undefined : sessionWorkspaces.get(activeSessionId)) ?? activeWorkspaceId;\n const failed = [\n 'global',\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. */\nexport function installedWebPlugins(): readonly WebPluginDefinition[] {\n return activeState().plugins;\n}\n\nexport interface InstalledRepositorySettingsPanel extends RepositorySettingsPanelContribution {\n pluginId: string;\n}\n\n/** Package panels placed under the host's repository controls, in stable display order. */\nexport function pluginRepositorySettingsPanels(): readonly InstalledRepositorySettingsPanel[] {\n return (workspaceState() ?? emptyState()).plugins\n .flatMap((plugin) =>\n plugin.repositorySettingsPanel === undefined ? [] : [{ 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\nexport 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. */\nexport 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. */\nexport 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 */\nexport function pluginSettingsSections(\n scope: 'global' | 'workspace' = 'global',\n): readonly SettingsSectionContribution[] {\n const sections = (scope === 'global' ? defaultState : workspaceState())?.settingsSections ?? [];\n return isDesktopClient() ? sections : sections.filter((section) => !section.desktopOnly);\n}\n\nexport interface InstalledSettingsPanel extends SettingsPanelContribution {\n pluginId: string;\n}\n\n/** The settings pages plugins draw themselves, in install order; the reader sorts them with the sections. */\nexport 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. */\nexport 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. */\nexport function workspaceSlotFills(workspaceId: string, slot: string): readonly ResolvedFill[] {\n return workspaceStates.get(workspaceId)?.fills.get(slot) ?? [];\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/** Home reads an explicit host mount, never the focused session or workspace. */\nexport 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: 'global' } : 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\nexport function paletteCommands(): readonly PaletteCommandContribution[] {\n return activeState().commands;\n}\n\n/** Context actions from every installed plugin, in stable display order. */\nexport 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. */\nexport 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. */\nexport function pluginLeaderBindings(): readonly LeaderBindingContribution[] {\n return activeState().leaderBindings;\n}\n\n/** Selection-axis declarations from every installed plugin, in display order. */\nexport function pluginSelectionAxes(): readonly SelectionAxisContribution[] {\n return activeState().selectionAxes;\n}\n\n/** Minor-mode declarations from every installed plugin, in display order. */\nexport function pluginMinorModes(): readonly MinorModeContribution[] {\n return activeState().minorModes;\n}\n\n/** Activity-dock group declarations from every installed plugin, in display order. */\nexport function pluginActivityGroups(): readonly ActivityGroupContribution[] {\n const groups = activeState().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 */\nexport 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 */\nexport 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\nfunction 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 */\nexport 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\nexport function sessionWebPluginsInstalled(sessionId: string): boolean {\n return sessionStates.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 */\nfunction 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\nexport 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. */\nexport 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/** Starts every plugin runtime in install order; the disposer runs in reverse. */\nexport function startPluginDefinitions(plugins: readonly WebPluginDefinition[], runtime: WebPluginRuntime): () => void {\n const disposers: Array<() => void> = [];\n const disposeStarted = (): void => {\n for (const dispose of disposers.reverse()) dispose();\n };\n try {\n for (const plugin of plugins) {\n const dispose = plugin.start?.(runtime);\n if (dispose) disposers.push(dispose);\n }\n } catch (error) {\n disposeStarted();\n throw error;\n }\n return disposeStarted;\n}\n\nexport function startWebPlugins(runtime: WebPluginRuntime): () => void {\n return startPluginDefinitions(activeState().plugins, runtime);\n}\n"],"mappings":";;;;;;AAkGA,MAAa,aAAa;CACxB,MAAM;CACN,SAAS;CACT,MAAM;CACN,SAAS;CACT,cAAc;CACd,UAAU;CACV,iBAAiB;CACjB,cAAc;CACd,aAAa;;CAEb,YAAY;AACd;AAEA,MAAM,iBAAiB;AACvB,MAAM,qBAAqB;AAC3B,MAAM,sBAA2C,IAAI,IAAI,OAAO,OAAO,UAAU,CAAC;;AAGlF,SAAgB,kBAAkB,MAAsB;CACtD,OAAO,GAAG,WAAW,WAAW,iBAAiB;AACnD;AAwBA,SAAS,aAA4B;CACnC,OAAO;EACL,SAAS,CAAC;EACV,MAAM,CAAC;EACP,WAAW,CAAC;EACZ,0BAAU,IAAI,IAAI;EAClB,UAAU,CAAC;EACX,gBAAgB,CAAC;EACjB,oBAAoB,CAAC;EACrB,gBAAgB,CAAC;EACjB,eAAe,CAAC;EAChB,YAAY,CAAC;EACb,gBAAgB,CAAC;EACjB,kBAAkB,CAAC;EACnB,gBAAgB,CAAC;EACjB,+BAAe,IAAI,IAAI;EACvB,cAAc,CAAC;EACf,uBAAO,IAAI,IAAI;EACf,uBAAO,IAAI,IAAI;EACf,WAAW,CAAC;EACZ,aAAa,CAAC;CAChB;AACF;AAEA,IAAI,eAAe,WAAW;AAC9B,IAAI,kBAAkB;AACtB,IAAI,mBAAmB;AACvB,MAAM,gCAAgB,IAAI,IAA2B;AACrD,MAAM,kCAAkB,IAAI,IAA2B;AACvD,MAAM,iCAAiB,IAAI,IAA4C;AACvE,MAAM,oCAAoB,IAAI,IAAoB;AAClD,IAAI,oBAAmC;AACvC,MAAM,uCAAuB,IAAI,IAAkD;AACnF,MAAM,4BAA4B;AAClC,IAAI,kBAAiC;;AAErC,MAAM,k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,IAAI,WAAW,KAAA,GAAW,QAAQ,OAAO,MAAM;CACjD;CACA,QAAQ,IAAI,MAAM,MAAM,KAAK;CAC7B,qBAAqB,IAAI,MAAM,WAAW,OAAO;CACjD,OAAO;AACT;;AAGA,SAAgB,sBAAsB,WAAyB;CAC7D,qBAAqB,OAAO,SAAS;CACrC,MAAM,QAAQ,cAAc,IAAI,SAAS,MAAM,oBAAoB,OAAO,eAAe,KAAA;CACzF,KAAK,MAAM,WAAW,OAAO,SAAS,OAAO,KAAK,CAAC,GAAG,QAAQ,KAAK,SAAS;AAC9E;;AAGA,SAAgB,uBAAuB,SAAyC,SAAuC;CACrH,MAAM,YAA+B,CAAC;CACtC,MAAM,uBAA6B;EACjC,KAAK,MAAM,WAAW,UAAU,QAAQ,GAAG,QAAQ;CACrD;CACA,IAAI;EACF,KAAK,MAAM,UAAU,SAAS;GAC5B,MAAM,UAAU,OAAO,QAAQ,OAAO;GACtC,IAAI,SAAS,UAAU,KAAK,OAAO;EACrC;CACF,SAAS,OAAO;EACd,eAAe;EACf,MAAM;CACR;CACA,OAAO;AACT;AAEA,SAAgB,gBAAgB,SAAuC;CACrE,OAAO,uBAAuB,YAAY,CAAC,CAAC,SAAS,OAAO;AAC9D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NativeTemplateCatalog, WebTemplateCatalog } from "./templateCatalog.mjs";
|
|
2
2
|
import { ComponentType } from "react";
|
|
3
|
-
import { ActivityGroupContribution, ContextActionContribution, DockFaceContribution, FileLinkSource, LeaderBindingContribution, MinorModeContribution, PaletteCommandContribution, RepositorySettingsPanelContribution, SelectionAxisContribution, SettingsPanelContribution, SettingsSectionContribution, TabContribution, ToolRendererContribution, UserMessageActionContribution, WebPluginDefinition, WebPluginMount, WebPluginRuntime, WebPluginSlotProps } from "@agimon-ai/po-core/web";
|
|
3
|
+
import { ActivityGroupContribution, ContextActionContribution, DockFaceContribution, FileLinkSource, HomeContribution, LeaderBindingContribution, MinorModeContribution, PaletteCommandContribution, RepositorySettingsPanelContribution, SelectionAxisContribution, SettingsPanelContribution, SettingsSectionContribution, TabContribution, ToolRendererContribution, UserMessageActionContribution, WebPluginDefinition, WebPluginMount, WebPluginRuntime, WebPluginSlotProps } from "@agimon-ai/po-core/web";
|
|
4
4
|
//#region src/web/lib/pluginRegistry.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* The installed plugin set.
|
|
@@ -43,6 +43,7 @@ export interface InstalledUserMessageAction extends UserMessageActionContributio
|
|
|
43
43
|
}
|
|
44
44
|
/** The slots the host itself declares; a plugin's own slots are namespaced by its id instead. */
|
|
45
45
|
export declare const HOST_SLOTS: {
|
|
46
|
+
readonly home: 'home';
|
|
46
47
|
readonly overlay: 'overlay';
|
|
47
48
|
readonly rail: 'rail';
|
|
48
49
|
readonly context: 'context';
|
|
@@ -113,6 +114,19 @@ export declare function pluginSettingsPanels(): readonly InstalledSettingsPanel[
|
|
|
113
114
|
export declare function slotFills(slot: string, sessionId?: string | null): readonly ResolvedFill[];
|
|
114
115
|
/** One workspace's own fills for a slot, whichever session or workspace is focused. */
|
|
115
116
|
export declare function workspaceSlotFills(workspaceId: string, slot: string): readonly ResolvedFill[];
|
|
117
|
+
export interface InstalledHomeContribution {
|
|
118
|
+
pluginId: string;
|
|
119
|
+
id: string;
|
|
120
|
+
order: number;
|
|
121
|
+
data: HomeContribution;
|
|
122
|
+
mount: Exclude<WebPluginMount, {
|
|
123
|
+
scope: 'session';
|
|
124
|
+
}>;
|
|
125
|
+
}
|
|
126
|
+
/** Home reads an explicit host mount, never the focused session or workspace. */
|
|
127
|
+
export declare function pluginHomeContributions(mount: Exclude<WebPluginMount, {
|
|
128
|
+
scope: 'session';
|
|
129
|
+
}>): readonly InstalledHomeContribution[];
|
|
116
130
|
export declare function paletteCommands(): readonly PaletteCommandContribution[];
|
|
117
131
|
/** Context actions from every installed plugin, in stable display order. */
|
|
118
132
|
export declare function pluginContextActions(sessionId?: string | null): readonly InstalledContextAction[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pluginRegistry.d.mts","names":[],"sources":["../../../src/web/lib/pluginRegistry.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"pluginRegistry.d.mts","names":[],"sources":["../../../src/web/lib/pluginRegistry.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;YAsDY;iBAmBK;;EAEf;EACA,MAAM;EACN;;;iBAIe;EACf;EACA;EACA;EACA;EACA;EACA,YAAY,cAAc;;iBAGX,+BAA+B;EAC9C;;iBAGe,mCAAmC;EAClD;;;qBAGW;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;;wBAQc,kBAAkB;;wBAqFlB,mBAAmB,QAAQ,iBAAiB;;wBAe5C,sBAAsB,OAAO,iBAAiB;wBA4B9C,wBAAwB,kBAAkB;wBAM1C,2BAA2B,qBAAqB,kBAAkB;wBAOlE,0BAA0B;wBAQ1B,2BAA2B;wBAM3B,wBAAwB,mBAAmB;wBA8Y3C,kBAAkB,kBAAkB;wBAOpC;;wBAKA;;wBAgBA,yBAAyB,mBAAmB,kBAAkB;;wBAW9D,yBAAyB;;wBAOzB,wBAAwB;wBAYxB,2BAA2B;wBAK3B;;;;;wBAQA,4BAA4B,OAAO,gBAAgB,sBAAsB;;;;;wBAiBzE,iCAAiC;;wBAajC,gCAAgC;iBAI/B,yCAAyC;EACxD;;;wBAIc,2CAA2C;wBAY3C,QAAQ,qCAAqC;;wBAK7C,4BAA4B;;wBAK5B;;;;;wBAUA,uBACd,0CACU;iBAKK,+BAA+B;EAC9C;;;wBAIc,iCAAiC;;wBAKjC,UAAU,cAAc,qCAAqC;;wBAK7D,mBAAmB,qBAAqB,wBAAwB;iBAI/D;EACf;EACA;EACA;EACA,MAAM;EACN,OAAO,QAAQ;IAAkB;;;;wBAInB,wBACd,OAAO,QAAQ;EAAkB;cACvB;wBA0BI,4BAA4B;;wBAK5B,qBAAqB,qCAAqC;;wBAK1D,qCAAqC;;wBAKrC,iCAAiC;;wBAKjC,gCAAgC;;wBAKhC,6BAA6B;;wBAK7B,iCAAiC;;;;;;;;;wBAajC,gBAAgB,qCAAqC;;;;;;;wBAUrD,mBACd,kBACA,WAAU,SAAS,yBACnB,oBACC;;;;;wBA2Ba,oBACd,mBACA,kBACA,WAAU,SAAS,yBACnB,oBACC;wBAKa,2BAA2B;wBAkB3B,qBAAqB,OAAO;;wBAmB5B,sBAAsB;;wBAOtB,uBAAuB,kBAAkB,uBAAuB,SAAS;wBAiBzE,gBAAgB,SAAS"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { leaderConflicts } from "./leaderTree.mjs";
|
|
2
2
|
import { mergeScopedPlugins, pluginsAtScope } from "./pluginScopes.mjs";
|
|
3
3
|
import { collectNativeTemplates, collectWebTemplates } from "./templateCatalog.mjs";
|
|
4
|
+
import { parseHomeContribution } from "@agimon-ai/po-core/web";
|
|
4
5
|
//#region src/web/lib/pluginRegistry.ts
|
|
5
6
|
/** The slots the host itself declares; a plugin's own slots are namespaced by its id instead. */
|
|
6
7
|
const HOST_SLOTS = {
|
|
8
|
+
home: "home",
|
|
7
9
|
overlay: "overlay",
|
|
8
10
|
rail: "rail",
|
|
9
11
|
context: "context",
|
|
@@ -103,12 +105,12 @@ function rebuildSession(sessionId) {
|
|
|
103
105
|
return state;
|
|
104
106
|
}
|
|
105
107
|
function installGlobalWebPlugins(plugins) {
|
|
106
|
-
defaultState = buildWebPluginState(pluginsAtScope(plugins, "global"));
|
|
108
|
+
defaultState = buildWebPluginState(pluginsAtScope(plugins, "global"), plugins);
|
|
107
109
|
for (const id of sessionPlugins.keys()) rebuildSession(id);
|
|
108
110
|
emitRegistryChange();
|
|
109
111
|
}
|
|
110
112
|
function installWorkspaceWebPlugins(workspaceId, plugins) {
|
|
111
|
-
const state = buildWebPluginState(pluginsAtScope(plugins, "workspace"));
|
|
113
|
+
const state = buildWebPluginState(pluginsAtScope(plugins, "workspace"), plugins);
|
|
112
114
|
workspaceStates.set(workspaceId, state);
|
|
113
115
|
for (const [id, owner] of sessionWorkspaces) if (owner === workspaceId) rebuildSession(id);
|
|
114
116
|
emitRegistryChange();
|
|
@@ -255,7 +257,7 @@ function resolveLeaderConflicts(bindings) {
|
|
|
255
257
|
});
|
|
256
258
|
}
|
|
257
259
|
}
|
|
258
|
-
function buildWebPluginState(plugins) {
|
|
260
|
+
function buildWebPluginState(plugins, definitions = plugins) {
|
|
259
261
|
const previous = installingState;
|
|
260
262
|
installingState = emptyState();
|
|
261
263
|
try {
|
|
@@ -375,6 +377,10 @@ function buildWebPluginState(plugins) {
|
|
|
375
377
|
}
|
|
376
378
|
installingState.diagnostics.push(...collectWebTemplates(installingState.plugins).diagnostics);
|
|
377
379
|
for (const slot of Object.values(HOST_SLOTS)) installingState.slots.set(slot, { slot });
|
|
380
|
+
installingState.slots.set(HOST_SLOTS.home, {
|
|
381
|
+
slot: HOST_SLOTS.home,
|
|
382
|
+
parse: parseHomeContribution
|
|
383
|
+
});
|
|
378
384
|
for (const group of installingState.activityGroups) installingState.slots.set(activityGroupSlot(group.name), { slot: activityGroupSlot(group.name) });
|
|
379
385
|
for (const declaration of pendingSlots) installingState.slots.set(declaration.slot, declaration);
|
|
380
386
|
for (const { pluginId, section } of pendingSections) {
|
|
@@ -384,7 +390,27 @@ function buildWebPluginState(plugins) {
|
|
|
384
390
|
fill: surfaceFill(installingState.slots.has(keyed) ? keyed : HOST_SLOTS.activity, section)
|
|
385
391
|
});
|
|
386
392
|
}
|
|
387
|
-
for (const { pluginId, fill } of pendingFills)
|
|
393
|
+
for (const { pluginId, fill } of pendingFills) {
|
|
394
|
+
if (fill.slot === HOST_SLOTS.home) {
|
|
395
|
+
const data = parseHomeContribution(fill.data);
|
|
396
|
+
const definition = definitions.find((plugin) => plugin.id === pluginId);
|
|
397
|
+
const sources = [
|
|
398
|
+
definition,
|
|
399
|
+
definition?.global,
|
|
400
|
+
definition?.workspace,
|
|
401
|
+
definition?.session
|
|
402
|
+
].flatMap((contribution) => contribution?.channels ?? []);
|
|
403
|
+
if (data === null || !sources.some((channel) => channel.channel === data.source)) {
|
|
404
|
+
installingState.diagnostics.push({
|
|
405
|
+
pluginId,
|
|
406
|
+
kind: "rejected-fill",
|
|
407
|
+
message: `Web plugin '${pluginId}' Home fill '${fill.id}' needs valid data and an owned source channel.`
|
|
408
|
+
});
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
placeFill(pluginId, fill);
|
|
413
|
+
}
|
|
388
414
|
for (const list of installingState.fills.values()) list.sort(byFillOrder);
|
|
389
415
|
resolveLeaderConflicts(pendingBindings);
|
|
390
416
|
installingState.leaderBindings.push(...pendingBindings.map((entry) => entry.binding));
|
|
@@ -521,6 +547,28 @@ function slotFills(slot, sessionId) {
|
|
|
521
547
|
function workspaceSlotFills(workspaceId, slot) {
|
|
522
548
|
return workspaceStates.get(workspaceId)?.fills.get(slot) ?? [];
|
|
523
549
|
}
|
|
550
|
+
/** Home reads an explicit host mount, never the focused session or workspace. */
|
|
551
|
+
function pluginHomeContributions(mount) {
|
|
552
|
+
const global = defaultState.fills.get(HOST_SLOTS.home) ?? [];
|
|
553
|
+
const workspace = mount.scope === "workspace" ? workspaceStates.get(mount.workspaceId)?.fills.get(HOST_SLOTS.home) ?? [] : [];
|
|
554
|
+
const seen = /* @__PURE__ */ new Set();
|
|
555
|
+
const contributions = [];
|
|
556
|
+
for (const fill of [...global, ...workspace]) {
|
|
557
|
+
const data = parseHomeContribution(fill.data);
|
|
558
|
+
if (data === null) continue;
|
|
559
|
+
const key = `${fill.pluginId}\0${data.source}`;
|
|
560
|
+
if (seen.has(key)) continue;
|
|
561
|
+
seen.add(key);
|
|
562
|
+
contributions.push({
|
|
563
|
+
pluginId: fill.pluginId,
|
|
564
|
+
id: fill.id,
|
|
565
|
+
order: fill.order,
|
|
566
|
+
data,
|
|
567
|
+
mount: global.includes(fill) ? { scope: "global" } : mount
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
return contributions.sort((left, right) => left.order - right.order || left.pluginId.localeCompare(right.pluginId) || left.id.localeCompare(right.id));
|
|
571
|
+
}
|
|
524
572
|
function paletteCommands() {
|
|
525
573
|
return activeState().commands;
|
|
526
574
|
}
|
|
@@ -645,6 +693,6 @@ function startWebPlugins(runtime) {
|
|
|
645
693
|
return startPluginDefinitions(activeState().plugins, runtime);
|
|
646
694
|
}
|
|
647
695
|
//#endregion
|
|
648
|
-
export { HOST_SLOTS, activateWebPluginSession, activateWebPluginWorkspace, activityGroupSlot, bindSessionWebWorkspace, dispatchChannelFrame, dropPluginSessionData, installGlobalWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, isDesktopClient, nativeTemplateCatalog, paletteCommands, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginLeaderBindings, pluginMinorModes, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSettingsPanels, pluginSettingsSections, pluginToolRenderer, pluginUserMessageActions, removeSessionWebPlugins, removeWorkspaceWebPlugins, resetWebPlugins, sessionToolRenderer, sessionWebPluginsInstalled, setWebPluginLoadDiagnostics, slotFills, startPluginDefinitions, startWebPlugins, subscribeWebPluginRegistry, webPluginDiagnostics, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceSlotFills };
|
|
696
|
+
export { HOST_SLOTS, activateWebPluginSession, activateWebPluginWorkspace, activityGroupSlot, bindSessionWebWorkspace, dispatchChannelFrame, dropPluginSessionData, installGlobalWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, isDesktopClient, nativeTemplateCatalog, paletteCommands, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMinorModes, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSettingsPanels, pluginSettingsSections, pluginToolRenderer, pluginUserMessageActions, removeSessionWebPlugins, removeWorkspaceWebPlugins, resetWebPlugins, sessionToolRenderer, sessionWebPluginsInstalled, setWebPluginLoadDiagnostics, slotFills, startPluginDefinitions, startWebPlugins, subscribeWebPluginRegistry, webPluginDiagnostics, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceSlotFills };
|
|
649
697
|
|
|
650
698
|
//# sourceMappingURL=pluginRegistry.mjs.map
|