@agimon-ai/po-web-dashboard 0.0.0-alpha.0
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 +29 -0
- package/README.md +10 -0
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/core.cjs +222 -0
- package/dist/core.d.mts +21 -0
- package/dist/core.mjs +21 -0
- package/dist/index.cjs +546 -0
- package/dist/index.d.mts +81 -0
- package/dist/index.mjs +81 -0
- package/dist/testing.cjs +18 -0
- package/dist/testing.d.mts +6 -0
- package/dist/testing.mjs +6 -0
- package/dist/types/auth.cjs +20 -0
- package/dist/types/auth.cjs.map +1 -0
- package/dist/types/auth.d.mts +160 -0
- package/dist/types/auth.d.mts.map +1 -0
- package/dist/types/auth.mjs +19 -0
- package/dist/types/auth.mjs.map +1 -0
- package/dist/types/bridge.d.mts +18 -0
- package/dist/types/bridge.d.mts.map +1 -0
- package/dist/types/devProxy.cjs +41 -0
- package/dist/types/devProxy.cjs.map +1 -0
- package/dist/types/devProxy.d.mts +54 -0
- package/dist/types/devProxy.d.mts.map +1 -0
- package/dist/types/devProxy.mjs +39 -0
- package/dist/types/devProxy.mjs.map +1 -0
- package/dist/types/hub.cjs +220 -0
- package/dist/types/hub.cjs.map +1 -0
- package/dist/types/hub.d.mts +447 -0
- package/dist/types/hub.d.mts.map +1 -0
- package/dist/types/hub.mjs +179 -0
- package/dist/types/hub.mjs.map +1 -0
- package/dist/types/media.cjs +75 -0
- package/dist/types/media.cjs.map +1 -0
- package/dist/types/media.d.mts +22 -0
- package/dist/types/media.d.mts.map +1 -0
- package/dist/types/media.mjs +70 -0
- package/dist/types/media.mjs.map +1 -0
- package/dist/types/notification.cjs +19 -0
- package/dist/types/notification.cjs.map +1 -0
- package/dist/types/notification.d.mts +10 -0
- package/dist/types/notification.d.mts.map +1 -0
- package/dist/types/notification.mjs +19 -0
- package/dist/types/notification.mjs.map +1 -0
- package/dist/types/remoteAccess.cjs +92 -0
- package/dist/types/remoteAccess.cjs.map +1 -0
- package/dist/types/remoteAccess.d.mts +214 -0
- package/dist/types/remoteAccess.d.mts.map +1 -0
- package/dist/types/remoteAccess.mjs +68 -0
- package/dist/types/remoteAccess.mjs.map +1 -0
- package/dist/types/session.cjs +23 -0
- package/dist/types/session.cjs.map +1 -0
- package/dist/types/session.d.mts +29 -0
- package/dist/types/session.d.mts.map +1 -0
- package/dist/types/session.mjs +18 -0
- package/dist/types/session.mjs.map +1 -0
- package/dist/types/sessionMcp.d.mts +56 -0
- package/dist/types/sessionMcp.d.mts.map +1 -0
- package/dist/types/settings.cjs +18 -0
- package/dist/types/settings.cjs.map +1 -0
- package/dist/types/settings.d.mts +126 -0
- package/dist/types/settings.d.mts.map +1 -0
- package/dist/types/settings.mjs +12 -0
- package/dist/types/settings.mjs.map +1 -0
- package/dist/types.cjs +101 -0
- package/dist/types.d.mts +11 -0
- package/dist/types.mjs +9 -0
- package/dist/views.cjs +120 -0
- package/dist/views.d.mts +56 -0
- package/dist/views.mjs +56 -0
- package/dist/web/components/MascotMark.cjs +18 -0
- package/dist/web/components/MascotMark.cjs.map +1 -0
- package/dist/web/components/MascotMark.d.mts +9 -0
- package/dist/web/components/MascotMark.d.mts.map +1 -0
- package/dist/web/components/MascotMark.mjs +18 -0
- package/dist/web/components/MascotMark.mjs.map +1 -0
- package/dist/web/components/PluginSurface.cjs +15 -0
- package/dist/web/components/PluginSurface.cjs.map +1 -0
- package/dist/web/components/PluginSurface.d.mts +13 -0
- package/dist/web/components/PluginSurface.d.mts.map +1 -0
- package/dist/web/components/PluginSurface.mjs +15 -0
- package/dist/web/components/PluginSurface.mjs.map +1 -0
- package/dist/web/components/QrCode.cjs +37 -0
- package/dist/web/components/QrCode.cjs.map +1 -0
- package/dist/web/components/QrCode.d.mts +22 -0
- package/dist/web/components/QrCode.d.mts.map +1 -0
- package/dist/web/components/QrCode.mjs +37 -0
- package/dist/web/components/QrCode.mjs.map +1 -0
- package/dist/web/components/Remote.fixture.cjs +73 -0
- package/dist/web/components/Remote.fixture.cjs.map +1 -0
- package/dist/web/components/Remote.fixture.mjs +72 -0
- package/dist/web/components/Remote.fixture.mjs.map +1 -0
- package/dist/web/components/SessionMcp.cjs +279 -0
- package/dist/web/components/SessionMcp.cjs.map +1 -0
- package/dist/web/components/SessionMcp.d.mts +12 -0
- package/dist/web/components/SessionMcp.d.mts.map +1 -0
- package/dist/web/components/SessionMcp.mjs +278 -0
- package/dist/web/components/SessionMcp.mjs.map +1 -0
- package/dist/web/components/Story.fixture.cjs +124 -0
- package/dist/web/components/Story.fixture.cjs.map +1 -0
- package/dist/web/components/Story.fixture.d.mts +19 -0
- package/dist/web/components/Story.fixture.d.mts.map +1 -0
- package/dist/web/components/Story.fixture.mjs +119 -0
- package/dist/web/components/Story.fixture.mjs.map +1 -0
- package/dist/web/components/Template.fixture.cjs +67 -0
- package/dist/web/components/Template.fixture.cjs.map +1 -0
- package/dist/web/components/Template.fixture.d.mts +7 -0
- package/dist/web/components/Template.fixture.d.mts.map +1 -0
- package/dist/web/components/Template.fixture.mjs +65 -0
- package/dist/web/components/Template.fixture.mjs.map +1 -0
- package/dist/web/components/ToolRendererBoundary.cjs +23 -0
- package/dist/web/components/ToolRendererBoundary.cjs.map +1 -0
- package/dist/web/components/ToolRendererBoundary.d.mts +23 -0
- package/dist/web/components/ToolRendererBoundary.d.mts.map +1 -0
- package/dist/web/components/ToolRendererBoundary.mjs +23 -0
- package/dist/web/components/ToolRendererBoundary.mjs.map +1 -0
- package/dist/web/features/activity/ActivityDock.cjs +271 -0
- package/dist/web/features/activity/ActivityDock.cjs.map +1 -0
- package/dist/web/features/activity/ActivityDock.d.mts +22 -0
- package/dist/web/features/activity/ActivityDock.d.mts.map +1 -0
- package/dist/web/features/activity/ActivityDock.mjs +271 -0
- package/dist/web/features/activity/ActivityDock.mjs.map +1 -0
- package/dist/web/features/activity/ContextItemDialog.cjs +276 -0
- package/dist/web/features/activity/ContextItemDialog.cjs.map +1 -0
- package/dist/web/features/activity/ContextItemDialog.d.mts +16 -0
- package/dist/web/features/activity/ContextItemDialog.d.mts.map +1 -0
- package/dist/web/features/activity/ContextItemDialog.mjs +276 -0
- package/dist/web/features/activity/ContextItemDialog.mjs.map +1 -0
- package/dist/web/features/activity/ContextPanel.cjs +248 -0
- package/dist/web/features/activity/ContextPanel.cjs.map +1 -0
- package/dist/web/features/activity/ContextPanel.d.mts +4 -0
- package/dist/web/features/activity/ContextPanel.d.mts.map +1 -0
- package/dist/web/features/activity/ContextPanel.mjs +248 -0
- package/dist/web/features/activity/ContextPanel.mjs.map +1 -0
- package/dist/web/features/activity/DockTabs.cjs +47 -0
- package/dist/web/features/activity/DockTabs.cjs.map +1 -0
- package/dist/web/features/activity/DockTabs.d.mts +9 -0
- package/dist/web/features/activity/DockTabs.d.mts.map +1 -0
- package/dist/web/features/activity/DockTabs.mjs +47 -0
- package/dist/web/features/activity/DockTabs.mjs.map +1 -0
- package/dist/web/features/connection/RefusedCard.cjs +76 -0
- package/dist/web/features/connection/RefusedCard.cjs.map +1 -0
- package/dist/web/features/connection/RefusedCard.d.mts +5 -0
- package/dist/web/features/connection/RefusedCard.d.mts.map +1 -0
- package/dist/web/features/connection/RefusedCard.mjs +76 -0
- package/dist/web/features/connection/RefusedCard.mjs.map +1 -0
- package/dist/web/features/dialogs/DialogOverlay.cjs +164 -0
- package/dist/web/features/dialogs/DialogOverlay.cjs.map +1 -0
- package/dist/web/features/dialogs/DialogOverlay.d.mts +15 -0
- package/dist/web/features/dialogs/DialogOverlay.d.mts.map +1 -0
- package/dist/web/features/dialogs/DialogOverlay.mjs +164 -0
- package/dist/web/features/dialogs/DialogOverlay.mjs.map +1 -0
- package/dist/web/features/leader/CommandPalette.cjs +390 -0
- package/dist/web/features/leader/CommandPalette.cjs.map +1 -0
- package/dist/web/features/leader/CommandPalette.d.mts +14 -0
- package/dist/web/features/leader/CommandPalette.d.mts.map +1 -0
- package/dist/web/features/leader/CommandPalette.mjs +390 -0
- package/dist/web/features/leader/CommandPalette.mjs.map +1 -0
- package/dist/web/features/remote/DevProxyTargets.cjs +122 -0
- package/dist/web/features/remote/DevProxyTargets.cjs.map +1 -0
- package/dist/web/features/remote/DevProxyTargets.d.mts +15 -0
- package/dist/web/features/remote/DevProxyTargets.d.mts.map +1 -0
- package/dist/web/features/remote/DevProxyTargets.mjs +122 -0
- package/dist/web/features/remote/DevProxyTargets.mjs.map +1 -0
- package/dist/web/features/remote/HandoverProgress.cjs +28 -0
- package/dist/web/features/remote/HandoverProgress.cjs.map +1 -0
- package/dist/web/features/remote/HandoverProgress.d.mts +12 -0
- package/dist/web/features/remote/HandoverProgress.d.mts.map +1 -0
- package/dist/web/features/remote/HandoverProgress.mjs +28 -0
- package/dist/web/features/remote/HandoverProgress.mjs.map +1 -0
- package/dist/web/features/remote/PairedDeviceList.cjs +37 -0
- package/dist/web/features/remote/PairedDeviceList.cjs.map +1 -0
- package/dist/web/features/remote/PairedDeviceList.d.mts +5 -0
- package/dist/web/features/remote/PairedDeviceList.d.mts.map +1 -0
- package/dist/web/features/remote/PairedDeviceList.mjs +37 -0
- package/dist/web/features/remote/PairedDeviceList.mjs.map +1 -0
- package/dist/web/features/remote/PairingApprovalDialog.cjs +65 -0
- package/dist/web/features/remote/PairingApprovalDialog.cjs.map +1 -0
- package/dist/web/features/remote/PairingApprovalDialog.d.mts +11 -0
- package/dist/web/features/remote/PairingApprovalDialog.d.mts.map +1 -0
- package/dist/web/features/remote/PairingApprovalDialog.mjs +65 -0
- package/dist/web/features/remote/PairingApprovalDialog.mjs.map +1 -0
- package/dist/web/features/remote/RemoteAccessDialog.cjs +83 -0
- package/dist/web/features/remote/RemoteAccessDialog.cjs.map +1 -0
- package/dist/web/features/remote/RemoteAccessDialog.d.mts +11 -0
- package/dist/web/features/remote/RemoteAccessDialog.d.mts.map +1 -0
- package/dist/web/features/remote/RemoteAccessDialog.mjs +83 -0
- package/dist/web/features/remote/RemoteAccessDialog.mjs.map +1 -0
- package/dist/web/features/remote/RemoteAccessOptions.cjs +154 -0
- package/dist/web/features/remote/RemoteAccessOptions.cjs.map +1 -0
- package/dist/web/features/remote/RemoteAccessOptions.d.mts +11 -0
- package/dist/web/features/remote/RemoteAccessOptions.d.mts.map +1 -0
- package/dist/web/features/remote/RemoteAccessOptions.mjs +154 -0
- package/dist/web/features/remote/RemoteAccessOptions.mjs.map +1 -0
- package/dist/web/features/remote/RemoteAccessPairing.cjs +93 -0
- package/dist/web/features/remote/RemoteAccessPairing.cjs.map +1 -0
- package/dist/web/features/remote/RemoteAccessPairing.d.mts +5 -0
- package/dist/web/features/remote/RemoteAccessPairing.d.mts.map +1 -0
- package/dist/web/features/remote/RemoteAccessPairing.mjs +93 -0
- package/dist/web/features/remote/RemoteAccessPairing.mjs.map +1 -0
- package/dist/web/features/remote/SandboxWorkspaces.cjs +87 -0
- package/dist/web/features/remote/SandboxWorkspaces.cjs.map +1 -0
- package/dist/web/features/remote/SandboxWorkspaces.d.mts +7 -0
- package/dist/web/features/remote/SandboxWorkspaces.d.mts.map +1 -0
- package/dist/web/features/remote/SandboxWorkspaces.mjs +87 -0
- package/dist/web/features/remote/SandboxWorkspaces.mjs.map +1 -0
- package/dist/web/features/remote/TrustedDeviceList.cjs +65 -0
- package/dist/web/features/remote/TrustedDeviceList.cjs.map +1 -0
- package/dist/web/features/remote/TrustedDeviceList.d.mts +13 -0
- package/dist/web/features/remote/TrustedDeviceList.d.mts.map +1 -0
- package/dist/web/features/remote/TrustedDeviceList.mjs +64 -0
- package/dist/web/features/remote/TrustedDeviceList.mjs.map +1 -0
- package/dist/web/features/selection/SelectionBar.cjs +401 -0
- package/dist/web/features/selection/SelectionBar.cjs.map +1 -0
- package/dist/web/features/selection/SelectionBar.d.mts +14 -0
- package/dist/web/features/selection/SelectionBar.d.mts.map +1 -0
- package/dist/web/features/selection/SelectionBar.mjs +400 -0
- package/dist/web/features/selection/SelectionBar.mjs.map +1 -0
- package/dist/web/features/session/AgentLockPanel.cjs +31 -0
- package/dist/web/features/session/AgentLockPanel.cjs.map +1 -0
- package/dist/web/features/session/AgentLockPanel.mjs +31 -0
- package/dist/web/features/session/AgentLockPanel.mjs.map +1 -0
- package/dist/web/features/session/Composer.cjs +808 -0
- package/dist/web/features/session/Composer.cjs.map +1 -0
- package/dist/web/features/session/Composer.d.mts +21 -0
- package/dist/web/features/session/Composer.d.mts.map +1 -0
- package/dist/web/features/session/Composer.mjs +806 -0
- package/dist/web/features/session/Composer.mjs.map +1 -0
- package/dist/web/features/session/ComposerPrompt.cjs +47 -0
- package/dist/web/features/session/ComposerPrompt.cjs.map +1 -0
- package/dist/web/features/session/ComposerPrompt.d.mts +16 -0
- package/dist/web/features/session/ComposerPrompt.d.mts.map +1 -0
- package/dist/web/features/session/ComposerPrompt.mjs +47 -0
- package/dist/web/features/session/ComposerPrompt.mjs.map +1 -0
- package/dist/web/features/session/DormantPanel.cjs +61 -0
- package/dist/web/features/session/DormantPanel.cjs.map +1 -0
- package/dist/web/features/session/DormantPanel.d.mts +8 -0
- package/dist/web/features/session/DormantPanel.d.mts.map +1 -0
- package/dist/web/features/session/DormantPanel.mjs +61 -0
- package/dist/web/features/session/DormantPanel.mjs.map +1 -0
- package/dist/web/features/session/MentionPreviews.cjs +128 -0
- package/dist/web/features/session/MentionPreviews.cjs.map +1 -0
- package/dist/web/features/session/MentionPreviews.d.mts +17 -0
- package/dist/web/features/session/MentionPreviews.d.mts.map +1 -0
- package/dist/web/features/session/MentionPreviews.mjs +127 -0
- package/dist/web/features/session/MentionPreviews.mjs.map +1 -0
- package/dist/web/features/session/MessageMarkdown.cjs +20 -0
- package/dist/web/features/session/MessageMarkdown.cjs.map +1 -0
- package/dist/web/features/session/MessageMarkdown.d.mts +19 -0
- package/dist/web/features/session/MessageMarkdown.d.mts.map +1 -0
- package/dist/web/features/session/MessageMarkdown.mjs +20 -0
- package/dist/web/features/session/MessageMarkdown.mjs.map +1 -0
- package/dist/web/features/session/QueueSheet.cjs +189 -0
- package/dist/web/features/session/QueueSheet.cjs.map +1 -0
- package/dist/web/features/session/QueueSheet.d.mts +16 -0
- package/dist/web/features/session/QueueSheet.d.mts.map +1 -0
- package/dist/web/features/session/QueueSheet.mjs +189 -0
- package/dist/web/features/session/QueueSheet.mjs.map +1 -0
- package/dist/web/features/session/SessionActivity.cjs +88 -0
- package/dist/web/features/session/SessionActivity.cjs.map +1 -0
- package/dist/web/features/session/SessionActivity.d.mts +16 -0
- package/dist/web/features/session/SessionActivity.d.mts.map +1 -0
- package/dist/web/features/session/SessionActivity.mjs +87 -0
- package/dist/web/features/session/SessionActivity.mjs.map +1 -0
- package/dist/web/features/session/SessionTranscriptView.cjs +34 -0
- package/dist/web/features/session/SessionTranscriptView.cjs.map +1 -0
- package/dist/web/features/session/SessionTranscriptView.d.mts +16 -0
- package/dist/web/features/session/SessionTranscriptView.d.mts.map +1 -0
- package/dist/web/features/session/SessionTranscriptView.mjs +34 -0
- package/dist/web/features/session/SessionTranscriptView.mjs.map +1 -0
- package/dist/web/features/session/ThreadView.cjs +40 -0
- package/dist/web/features/session/ThreadView.cjs.map +1 -0
- package/dist/web/features/session/ThreadView.d.mts +18 -0
- package/dist/web/features/session/ThreadView.d.mts.map +1 -0
- package/dist/web/features/session/ThreadView.mjs +40 -0
- package/dist/web/features/session/ThreadView.mjs.map +1 -0
- package/dist/web/features/session/Timeline.cjs +620 -0
- package/dist/web/features/session/Timeline.cjs.map +1 -0
- package/dist/web/features/session/Timeline.d.mts +28 -0
- package/dist/web/features/session/Timeline.d.mts.map +1 -0
- package/dist/web/features/session/Timeline.mjs +619 -0
- package/dist/web/features/session/Timeline.mjs.map +1 -0
- package/dist/web/features/session/ToolCard.cjs +210 -0
- package/dist/web/features/session/ToolCard.cjs.map +1 -0
- package/dist/web/features/session/ToolCard.d.mts +16 -0
- package/dist/web/features/session/ToolCard.d.mts.map +1 -0
- package/dist/web/features/session/ToolCard.mjs +210 -0
- package/dist/web/features/session/ToolCard.mjs.map +1 -0
- package/dist/web/features/session/session.fixture.cjs +76 -0
- package/dist/web/features/session/session.fixture.cjs.map +1 -0
- package/dist/web/features/session/session.fixture.d.mts +6 -0
- package/dist/web/features/session/session.fixture.d.mts.map +1 -0
- package/dist/web/features/session/session.fixture.mjs +74 -0
- package/dist/web/features/session/session.fixture.mjs.map +1 -0
- package/dist/web/features/sessions/NewSessionDialog.cjs +70 -0
- package/dist/web/features/sessions/NewSessionDialog.cjs.map +1 -0
- package/dist/web/features/sessions/NewSessionDialog.d.mts +9 -0
- package/dist/web/features/sessions/NewSessionDialog.d.mts.map +1 -0
- package/dist/web/features/sessions/NewSessionDialog.mjs +70 -0
- package/dist/web/features/sessions/NewSessionDialog.mjs.map +1 -0
- package/dist/web/features/sessions/ResumeSessionDialog.cjs +131 -0
- package/dist/web/features/sessions/ResumeSessionDialog.cjs.map +1 -0
- package/dist/web/features/sessions/ResumeSessionDialog.d.mts +14 -0
- package/dist/web/features/sessions/ResumeSessionDialog.d.mts.map +1 -0
- package/dist/web/features/sessions/ResumeSessionDialog.mjs +131 -0
- package/dist/web/features/sessions/ResumeSessionDialog.mjs.map +1 -0
- package/dist/web/features/sessions/SessionRailDialogs.cjs +62 -0
- package/dist/web/features/sessions/SessionRailDialogs.cjs.map +1 -0
- package/dist/web/features/sessions/SessionRailDialogs.d.mts +10 -0
- package/dist/web/features/sessions/SessionRailDialogs.d.mts.map +1 -0
- package/dist/web/features/sessions/SessionRailDialogs.mjs +62 -0
- package/dist/web/features/sessions/SessionRailDialogs.mjs.map +1 -0
- package/dist/web/features/sessions/WelcomePanel.cjs +42 -0
- package/dist/web/features/sessions/WelcomePanel.cjs.map +1 -0
- package/dist/web/features/sessions/WelcomePanel.d.mts +16 -0
- package/dist/web/features/sessions/WelcomePanel.d.mts.map +1 -0
- package/dist/web/features/sessions/WelcomePanel.mjs +42 -0
- package/dist/web/features/sessions/WelcomePanel.mjs.map +1 -0
- package/dist/web/features/sessions/useNewSessionActions.cjs +38 -0
- package/dist/web/features/sessions/useNewSessionActions.cjs.map +1 -0
- package/dist/web/features/sessions/useNewSessionActions.d.mts +12 -0
- package/dist/web/features/sessions/useNewSessionActions.d.mts.map +1 -0
- package/dist/web/features/sessions/useNewSessionActions.mjs +38 -0
- package/dist/web/features/sessions/useNewSessionActions.mjs.map +1 -0
- package/dist/web/features/sessions/useSessionRail.cjs +302 -0
- package/dist/web/features/sessions/useSessionRail.cjs.map +1 -0
- package/dist/web/features/sessions/useSessionRail.d.mts +14 -0
- package/dist/web/features/sessions/useSessionRail.d.mts.map +1 -0
- package/dist/web/features/sessions/useSessionRail.mjs +302 -0
- package/dist/web/features/sessions/useSessionRail.mjs.map +1 -0
- package/dist/web/features/settings/AppearanceSettings.cjs +126 -0
- package/dist/web/features/settings/AppearanceSettings.cjs.map +1 -0
- package/dist/web/features/settings/AppearanceSettings.d.mts +12 -0
- package/dist/web/features/settings/AppearanceSettings.d.mts.map +1 -0
- package/dist/web/features/settings/AppearanceSettings.mjs +126 -0
- package/dist/web/features/settings/AppearanceSettings.mjs.map +1 -0
- package/dist/web/features/settings/ContributedSettings.cjs +257 -0
- package/dist/web/features/settings/ContributedSettings.cjs.map +1 -0
- package/dist/web/features/settings/ContributedSettings.d.mts +14 -0
- package/dist/web/features/settings/ContributedSettings.d.mts.map +1 -0
- package/dist/web/features/settings/ContributedSettings.mjs +257 -0
- package/dist/web/features/settings/ContributedSettings.mjs.map +1 -0
- package/dist/web/features/settings/ImageSettings.cjs +146 -0
- package/dist/web/features/settings/ImageSettings.cjs.map +1 -0
- package/dist/web/features/settings/ImageSettings.d.mts +12 -0
- package/dist/web/features/settings/ImageSettings.d.mts.map +1 -0
- package/dist/web/features/settings/ImageSettings.mjs +146 -0
- package/dist/web/features/settings/ImageSettings.mjs.map +1 -0
- package/dist/web/features/settings/LoginFlowDialog.cjs +226 -0
- package/dist/web/features/settings/LoginFlowDialog.cjs.map +1 -0
- package/dist/web/features/settings/LoginFlowDialog.d.mts +15 -0
- package/dist/web/features/settings/LoginFlowDialog.d.mts.map +1 -0
- package/dist/web/features/settings/LoginFlowDialog.mjs +225 -0
- package/dist/web/features/settings/LoginFlowDialog.mjs.map +1 -0
- package/dist/web/features/settings/NotificationSettings.cjs +69 -0
- package/dist/web/features/settings/NotificationSettings.cjs.map +1 -0
- package/dist/web/features/settings/NotificationSettings.d.mts +5 -0
- package/dist/web/features/settings/NotificationSettings.d.mts.map +1 -0
- package/dist/web/features/settings/NotificationSettings.mjs +69 -0
- package/dist/web/features/settings/NotificationSettings.mjs.map +1 -0
- package/dist/web/features/settings/PluginSettings.cjs +106 -0
- package/dist/web/features/settings/PluginSettings.cjs.map +1 -0
- package/dist/web/features/settings/PluginSettings.d.mts +10 -0
- package/dist/web/features/settings/PluginSettings.d.mts.map +1 -0
- package/dist/web/features/settings/PluginSettings.mjs +106 -0
- package/dist/web/features/settings/PluginSettings.mjs.map +1 -0
- package/dist/web/features/settings/ProviderSettings.cjs +323 -0
- package/dist/web/features/settings/ProviderSettings.cjs.map +1 -0
- package/dist/web/features/settings/ProviderSettings.d.mts +9 -0
- package/dist/web/features/settings/ProviderSettings.d.mts.map +1 -0
- package/dist/web/features/settings/ProviderSettings.mjs +323 -0
- package/dist/web/features/settings/ProviderSettings.mjs.map +1 -0
- package/dist/web/features/settings/RemoteControlSettings.cjs +50 -0
- package/dist/web/features/settings/RemoteControlSettings.cjs.map +1 -0
- package/dist/web/features/settings/RemoteControlSettings.d.mts +5 -0
- package/dist/web/features/settings/RemoteControlSettings.d.mts.map +1 -0
- package/dist/web/features/settings/RemoteControlSettings.mjs +50 -0
- package/dist/web/features/settings/RemoteControlSettings.mjs.map +1 -0
- package/dist/web/features/settings/RepositorySettings.cjs +318 -0
- package/dist/web/features/settings/RepositorySettings.cjs.map +1 -0
- package/dist/web/features/settings/RepositorySettings.d.mts +7 -0
- package/dist/web/features/settings/RepositorySettings.d.mts.map +1 -0
- package/dist/web/features/settings/RepositorySettings.mjs +318 -0
- package/dist/web/features/settings/RepositorySettings.mjs.map +1 -0
- package/dist/web/features/settings/RepositoryWorkspace.cjs +160 -0
- package/dist/web/features/settings/RepositoryWorkspace.cjs.map +1 -0
- package/dist/web/features/settings/RepositoryWorkspace.d.mts +10 -0
- package/dist/web/features/settings/RepositoryWorkspace.d.mts.map +1 -0
- package/dist/web/features/settings/RepositoryWorkspace.mjs +160 -0
- package/dist/web/features/settings/RepositoryWorkspace.mjs.map +1 -0
- package/dist/web/features/settings/SessionMcpSettings.cjs +488 -0
- package/dist/web/features/settings/SessionMcpSettings.cjs.map +1 -0
- package/dist/web/features/settings/SessionMcpSettings.d.mts +5 -0
- package/dist/web/features/settings/SessionMcpSettings.d.mts.map +1 -0
- package/dist/web/features/settings/SessionMcpSettings.mjs +488 -0
- package/dist/web/features/settings/SessionMcpSettings.mjs.map +1 -0
- package/dist/web/features/settings/SettingsMenu.cjs +135 -0
- package/dist/web/features/settings/SettingsMenu.cjs.map +1 -0
- package/dist/web/features/settings/SettingsMenu.d.mts +9 -0
- package/dist/web/features/settings/SettingsMenu.d.mts.map +1 -0
- package/dist/web/features/settings/SettingsMenu.mjs +135 -0
- package/dist/web/features/settings/SettingsMenu.mjs.map +1 -0
- package/dist/web/features/settings/SettingsPanelHost.cjs +32 -0
- package/dist/web/features/settings/SettingsPanelHost.cjs.map +1 -0
- package/dist/web/features/settings/SettingsPanelHost.d.mts +8 -0
- package/dist/web/features/settings/SettingsPanelHost.d.mts.map +1 -0
- package/dist/web/features/settings/SettingsPanelHost.mjs +32 -0
- package/dist/web/features/settings/SettingsPanelHost.mjs.map +1 -0
- package/dist/web/features/settings/TemplateSettings.cjs +177 -0
- package/dist/web/features/settings/TemplateSettings.cjs.map +1 -0
- package/dist/web/features/settings/TemplateSettings.d.mts +8 -0
- package/dist/web/features/settings/TemplateSettings.d.mts.map +1 -0
- package/dist/web/features/settings/TemplateSettings.mjs +177 -0
- package/dist/web/features/settings/TemplateSettings.mjs.map +1 -0
- package/dist/web/features/settings/TunnelSettings.cjs +182 -0
- package/dist/web/features/settings/TunnelSettings.cjs.map +1 -0
- package/dist/web/features/settings/TunnelSettings.d.mts +8 -0
- package/dist/web/features/settings/TunnelSettings.d.mts.map +1 -0
- package/dist/web/features/settings/TunnelSettings.mjs +182 -0
- package/dist/web/features/settings/TunnelSettings.mjs.map +1 -0
- package/dist/web/features/settings/settings.fixture.cjs +230 -0
- package/dist/web/features/settings/settings.fixture.cjs.map +1 -0
- package/dist/web/features/settings/settings.fixture.d.mts +6 -0
- package/dist/web/features/settings/settings.fixture.d.mts.map +1 -0
- package/dist/web/features/settings/settings.fixture.mjs +223 -0
- package/dist/web/features/settings/settings.fixture.mjs.map +1 -0
- package/dist/web/features/status/TopBar.cjs +200 -0
- package/dist/web/features/status/TopBar.cjs.map +1 -0
- package/dist/web/features/status/TopBar.d.mts +11 -0
- package/dist/web/features/status/TopBar.d.mts.map +1 -0
- package/dist/web/features/status/TopBar.mjs +200 -0
- package/dist/web/features/status/TopBar.mjs.map +1 -0
- package/dist/web/lib/authApi.cjs +77 -0
- package/dist/web/lib/authApi.cjs.map +1 -0
- package/dist/web/lib/authApi.d.mts +28 -0
- package/dist/web/lib/authApi.d.mts.map +1 -0
- package/dist/web/lib/authApi.mjs +72 -0
- package/dist/web/lib/authApi.mjs.map +1 -0
- package/dist/web/lib/browserNotifications.cjs +37 -0
- package/dist/web/lib/browserNotifications.cjs.map +1 -0
- package/dist/web/lib/browserNotifications.d.mts +12 -0
- package/dist/web/lib/browserNotifications.d.mts.map +1 -0
- package/dist/web/lib/browserNotifications.mjs +35 -0
- package/dist/web/lib/browserNotifications.mjs.map +1 -0
- package/dist/web/lib/browserTelemetry.cjs +158 -0
- package/dist/web/lib/browserTelemetry.cjs.map +1 -0
- package/dist/web/lib/browserTelemetry.d.mts +28 -0
- package/dist/web/lib/browserTelemetry.d.mts.map +1 -0
- package/dist/web/lib/browserTelemetry.mjs +154 -0
- package/dist/web/lib/browserTelemetry.mjs.map +1 -0
- package/dist/web/lib/commands.cjs +176 -0
- package/dist/web/lib/commands.cjs.map +1 -0
- package/dist/web/lib/commands.d.mts +53 -0
- package/dist/web/lib/commands.d.mts.map +1 -0
- package/dist/web/lib/commands.mjs +153 -0
- package/dist/web/lib/commands.mjs.map +1 -0
- package/dist/web/lib/composerSubmissions.cjs +20 -0
- package/dist/web/lib/composerSubmissions.cjs.map +1 -0
- package/dist/web/lib/composerSubmissions.d.mts +7 -0
- package/dist/web/lib/composerSubmissions.d.mts.map +1 -0
- package/dist/web/lib/composerSubmissions.mjs +19 -0
- package/dist/web/lib/composerSubmissions.mjs.map +1 -0
- package/dist/web/lib/composition.cjs +403 -0
- package/dist/web/lib/composition.cjs.map +1 -0
- package/dist/web/lib/composition.d.mts +137 -0
- package/dist/web/lib/composition.d.mts.map +1 -0
- package/dist/web/lib/composition.mjs +392 -0
- package/dist/web/lib/composition.mjs.map +1 -0
- package/dist/web/lib/contextComposition.cjs +132 -0
- package/dist/web/lib/contextComposition.cjs.map +1 -0
- package/dist/web/lib/contextComposition.d.mts +75 -0
- package/dist/web/lib/contextComposition.d.mts.map +1 -0
- package/dist/web/lib/contextComposition.mjs +127 -0
- package/dist/web/lib/contextComposition.mjs.map +1 -0
- package/dist/web/lib/contextDetailApi.cjs +61 -0
- package/dist/web/lib/contextDetailApi.cjs.map +1 -0
- package/dist/web/lib/contextDetailApi.d.mts +12 -0
- package/dist/web/lib/contextDetailApi.d.mts.map +1 -0
- package/dist/web/lib/contextDetailApi.mjs +61 -0
- package/dist/web/lib/contextDetailApi.mjs.map +1 -0
- package/dist/web/lib/dashboardRenderers.cjs +9 -0
- package/dist/web/lib/dashboardRenderers.cjs.map +1 -0
- package/dist/web/lib/dashboardRenderers.d.mts +12 -0
- package/dist/web/lib/dashboardRenderers.d.mts.map +1 -0
- package/dist/web/lib/dashboardRenderers.mjs +9 -0
- package/dist/web/lib/dashboardRenderers.mjs.map +1 -0
- package/dist/web/lib/dashboardRoute.cjs +27 -0
- package/dist/web/lib/dashboardRoute.cjs.map +1 -0
- package/dist/web/lib/dashboardRoute.d.mts +29 -0
- package/dist/web/lib/dashboardRoute.d.mts.map +1 -0
- package/dist/web/lib/dashboardRoute.mjs +26 -0
- package/dist/web/lib/dashboardRoute.mjs.map +1 -0
- package/dist/web/lib/dashboardTranscript.cjs +15 -0
- package/dist/web/lib/dashboardTranscript.cjs.map +1 -0
- package/dist/web/lib/dashboardTranscript.d.mts +6 -0
- package/dist/web/lib/dashboardTranscript.d.mts.map +1 -0
- package/dist/web/lib/dashboardTranscript.mjs +14 -0
- package/dist/web/lib/dashboardTranscript.mjs.map +1 -0
- package/dist/web/lib/devProxyApi.cjs +74 -0
- package/dist/web/lib/devProxyApi.cjs.map +1 -0
- package/dist/web/lib/devProxyApi.d.mts +21 -0
- package/dist/web/lib/devProxyApi.d.mts.map +1 -0
- package/dist/web/lib/devProxyApi.mjs +72 -0
- package/dist/web/lib/devProxyApi.mjs.map +1 -0
- package/dist/web/lib/fileMentions.cjs +30 -0
- package/dist/web/lib/fileMentions.cjs.map +1 -0
- package/dist/web/lib/fileMentions.d.mts +13 -0
- package/dist/web/lib/fileMentions.d.mts.map +1 -0
- package/dist/web/lib/fileMentions.mjs +29 -0
- package/dist/web/lib/fileMentions.mjs.map +1 -0
- package/dist/web/lib/hubApi.cjs +283 -0
- package/dist/web/lib/hubApi.cjs.map +1 -0
- package/dist/web/lib/hubApi.d.mts +109 -0
- package/dist/web/lib/hubApi.d.mts.map +1 -0
- package/dist/web/lib/hubApi.mjs +268 -0
- package/dist/web/lib/hubApi.mjs.map +1 -0
- package/dist/web/lib/leaderTree.cjs +150 -0
- package/dist/web/lib/leaderTree.cjs.map +1 -0
- package/dist/web/lib/leaderTree.d.mts +41 -0
- package/dist/web/lib/leaderTree.d.mts.map +1 -0
- package/dist/web/lib/leaderTree.mjs +149 -0
- package/dist/web/lib/leaderTree.mjs.map +1 -0
- package/dist/web/lib/livePush.cjs +97 -0
- package/dist/web/lib/livePush.cjs.map +1 -0
- package/dist/web/lib/livePush.d.mts +10 -0
- package/dist/web/lib/livePush.d.mts.map +1 -0
- package/dist/web/lib/livePush.mjs +94 -0
- package/dist/web/lib/livePush.mjs.map +1 -0
- package/dist/web/lib/modelContextAdapter.cjs +63 -0
- package/dist/web/lib/modelContextAdapter.cjs.map +1 -0
- package/dist/web/lib/modelContextAdapter.d.mts +11 -0
- package/dist/web/lib/modelContextAdapter.d.mts.map +1 -0
- package/dist/web/lib/modelContextAdapter.mjs +62 -0
- package/dist/web/lib/modelContextAdapter.mjs.map +1 -0
- package/dist/web/lib/piTransport.cjs +103 -0
- package/dist/web/lib/piTransport.cjs.map +1 -0
- package/dist/web/lib/piTransport.d.mts +8 -0
- package/dist/web/lib/piTransport.d.mts.map +1 -0
- package/dist/web/lib/piTransport.mjs +102 -0
- package/dist/web/lib/piTransport.mjs.map +1 -0
- package/dist/web/lib/pluginCompositions.cjs +57 -0
- package/dist/web/lib/pluginCompositions.cjs.map +1 -0
- package/dist/web/lib/pluginCompositions.d.mts +37 -0
- package/dist/web/lib/pluginCompositions.d.mts.map +1 -0
- package/dist/web/lib/pluginCompositions.mjs +52 -0
- package/dist/web/lib/pluginCompositions.mjs.map +1 -0
- package/dist/web/lib/pluginRegistry.cjs +675 -0
- package/dist/web/lib/pluginRegistry.cjs.map +1 -0
- package/dist/web/lib/pluginRegistry.d.mts +155 -0
- package/dist/web/lib/pluginRegistry.d.mts.map +1 -0
- package/dist/web/lib/pluginRegistry.mjs +633 -0
- package/dist/web/lib/pluginRegistry.mjs.map +1 -0
- package/dist/web/lib/pluginScopes.cjs +48 -0
- package/dist/web/lib/pluginScopes.cjs.map +1 -0
- package/dist/web/lib/pluginScopes.d.mts +8 -0
- package/dist/web/lib/pluginScopes.d.mts.map +1 -0
- package/dist/web/lib/pluginScopes.mjs +47 -0
- package/dist/web/lib/pluginScopes.mjs.map +1 -0
- package/dist/web/lib/pluginSlotProps.cjs +83 -0
- package/dist/web/lib/pluginSlotProps.cjs.map +1 -0
- package/dist/web/lib/pluginSlotProps.d.mts +21 -0
- package/dist/web/lib/pluginSlotProps.d.mts.map +1 -0
- package/dist/web/lib/pluginSlotProps.mjs +82 -0
- package/dist/web/lib/pluginSlotProps.mjs.map +1 -0
- package/dist/web/lib/promptFocus.cjs +30 -0
- package/dist/web/lib/promptFocus.cjs.map +1 -0
- package/dist/web/lib/promptFocus.d.mts +7 -0
- package/dist/web/lib/promptFocus.d.mts.map +1 -0
- package/dist/web/lib/promptFocus.mjs +29 -0
- package/dist/web/lib/promptFocus.mjs.map +1 -0
- package/dist/web/lib/protocolHubSocket.cjs +107 -0
- package/dist/web/lib/protocolHubSocket.cjs.map +1 -0
- package/dist/web/lib/protocolHubSocket.d.mts +18 -0
- package/dist/web/lib/protocolHubSocket.d.mts.map +1 -0
- package/dist/web/lib/protocolHubSocket.mjs +107 -0
- package/dist/web/lib/protocolHubSocket.mjs.map +1 -0
- package/dist/web/lib/protocolTimeline.cjs +86 -0
- package/dist/web/lib/protocolTimeline.cjs.map +1 -0
- package/dist/web/lib/protocolTimeline.d.mts +9 -0
- package/dist/web/lib/protocolTimeline.d.mts.map +1 -0
- package/dist/web/lib/protocolTimeline.mjs +85 -0
- package/dist/web/lib/protocolTimeline.mjs.map +1 -0
- package/dist/web/lib/qrMatrix.cjs +37 -0
- package/dist/web/lib/qrMatrix.cjs.map +1 -0
- package/dist/web/lib/qrMatrix.d.mts +5 -0
- package/dist/web/lib/qrMatrix.d.mts.map +1 -0
- package/dist/web/lib/qrMatrix.mjs +35 -0
- package/dist/web/lib/qrMatrix.mjs.map +1 -0
- package/dist/web/lib/remoteApi.cjs +100 -0
- package/dist/web/lib/remoteApi.cjs.map +1 -0
- package/dist/web/lib/remoteApi.d.mts +45 -0
- package/dist/web/lib/remoteApi.d.mts.map +1 -0
- package/dist/web/lib/remoteApi.mjs +92 -0
- package/dist/web/lib/remoteApi.mjs.map +1 -0
- package/dist/web/lib/sealedSession.cjs +81 -0
- package/dist/web/lib/sealedSession.cjs.map +1 -0
- package/dist/web/lib/sealedSession.d.mts +24 -0
- package/dist/web/lib/sealedSession.d.mts.map +1 -0
- package/dist/web/lib/sealedSession.mjs +75 -0
- package/dist/web/lib/sealedSession.mjs.map +1 -0
- package/dist/web/lib/sessionActivityRenderer.cjs +19 -0
- package/dist/web/lib/sessionActivityRenderer.cjs.map +1 -0
- package/dist/web/lib/sessionActivityRenderer.d.mts +10 -0
- package/dist/web/lib/sessionActivityRenderer.d.mts.map +1 -0
- package/dist/web/lib/sessionActivityRenderer.mjs +17 -0
- package/dist/web/lib/sessionActivityRenderer.mjs.map +1 -0
- package/dist/web/lib/sessionAsset.cjs +45 -0
- package/dist/web/lib/sessionAsset.cjs.map +1 -0
- package/dist/web/lib/sessionAsset.d.mts +17 -0
- package/dist/web/lib/sessionAsset.d.mts.map +1 -0
- package/dist/web/lib/sessionAsset.mjs +44 -0
- package/dist/web/lib/sessionAsset.mjs.map +1 -0
- package/dist/web/lib/sessionAvatar.cjs +18 -0
- package/dist/web/lib/sessionAvatar.cjs.map +1 -0
- package/dist/web/lib/sessionAvatar.d.mts +10 -0
- package/dist/web/lib/sessionAvatar.d.mts.map +1 -0
- package/dist/web/lib/sessionAvatar.mjs +18 -0
- package/dist/web/lib/sessionAvatar.mjs.map +1 -0
- package/dist/web/lib/sessionMcpApi.cjs +120 -0
- package/dist/web/lib/sessionMcpApi.cjs.map +1 -0
- package/dist/web/lib/sessionMcpApi.d.mts +27 -0
- package/dist/web/lib/sessionMcpApi.d.mts.map +1 -0
- package/dist/web/lib/sessionMcpApi.mjs +114 -0
- package/dist/web/lib/sessionMcpApi.mjs.map +1 -0
- package/dist/web/lib/sessionMcpPrompt.cjs +24 -0
- package/dist/web/lib/sessionMcpPrompt.cjs.map +1 -0
- package/dist/web/lib/sessionMcpPrompt.mjs +23 -0
- package/dist/web/lib/sessionMcpPrompt.mjs.map +1 -0
- package/dist/web/lib/sessionModel.cjs +970 -0
- package/dist/web/lib/sessionModel.cjs.map +1 -0
- package/dist/web/lib/sessionModel.d.mts +254 -0
- package/dist/web/lib/sessionModel.d.mts.map +1 -0
- package/dist/web/lib/sessionModel.mjs +958 -0
- package/dist/web/lib/sessionModel.mjs.map +1 -0
- package/dist/web/lib/sessionProtocolCommands.cjs +196 -0
- package/dist/web/lib/sessionProtocolCommands.cjs.map +1 -0
- package/dist/web/lib/sessionProtocolCommands.d.mts +15 -0
- package/dist/web/lib/sessionProtocolCommands.d.mts.map +1 -0
- package/dist/web/lib/sessionProtocolCommands.mjs +193 -0
- package/dist/web/lib/sessionProtocolCommands.mjs.map +1 -0
- package/dist/web/lib/sessionRailModel.cjs +107 -0
- package/dist/web/lib/sessionRailModel.cjs.map +1 -0
- package/dist/web/lib/sessionRailModel.d.mts +38 -0
- package/dist/web/lib/sessionRailModel.d.mts.map +1 -0
- package/dist/web/lib/sessionRailModel.mjs +104 -0
- package/dist/web/lib/sessionRailModel.mjs.map +1 -0
- package/dist/web/lib/sessionSummary.cjs +58 -0
- package/dist/web/lib/sessionSummary.cjs.map +1 -0
- package/dist/web/lib/sessionSummary.d.mts +39 -0
- package/dist/web/lib/sessionSummary.d.mts.map +1 -0
- package/dist/web/lib/sessionSummary.mjs +54 -0
- package/dist/web/lib/sessionSummary.mjs.map +1 -0
- package/dist/web/lib/sessionTranscriptRenderer.cjs +19 -0
- package/dist/web/lib/sessionTranscriptRenderer.cjs.map +1 -0
- package/dist/web/lib/sessionTranscriptRenderer.d.mts +11 -0
- package/dist/web/lib/sessionTranscriptRenderer.d.mts.map +1 -0
- package/dist/web/lib/sessionTranscriptRenderer.mjs +17 -0
- package/dist/web/lib/sessionTranscriptRenderer.mjs.map +1 -0
- package/dist/web/lib/settingsApi.cjs +237 -0
- package/dist/web/lib/settingsApi.cjs.map +1 -0
- package/dist/web/lib/settingsApi.d.mts +57 -0
- package/dist/web/lib/settingsApi.d.mts.map +1 -0
- package/dist/web/lib/settingsApi.mjs +230 -0
- package/dist/web/lib/settingsApi.mjs.map +1 -0
- package/dist/web/lib/settingsDraft.cjs +48 -0
- package/dist/web/lib/settingsDraft.cjs.map +1 -0
- package/dist/web/lib/settingsDraft.d.mts +28 -0
- package/dist/web/lib/settingsDraft.d.mts.map +1 -0
- package/dist/web/lib/settingsDraft.mjs +45 -0
- package/dist/web/lib/settingsDraft.mjs.map +1 -0
- package/dist/web/lib/settingsSections.cjs +108 -0
- package/dist/web/lib/settingsSections.cjs.map +1 -0
- package/dist/web/lib/settingsSections.d.mts +36 -0
- package/dist/web/lib/settingsSections.d.mts.map +1 -0
- package/dist/web/lib/settingsSections.mjs +105 -0
- package/dist/web/lib/settingsSections.mjs.map +1 -0
- package/dist/web/lib/statusLine.cjs +82 -0
- package/dist/web/lib/statusLine.cjs.map +1 -0
- package/dist/web/lib/statusLine.d.mts +27 -0
- package/dist/web/lib/statusLine.d.mts.map +1 -0
- package/dist/web/lib/statusLine.mjs +79 -0
- package/dist/web/lib/statusLine.mjs.map +1 -0
- package/dist/web/lib/stepUp.cjs +41 -0
- package/dist/web/lib/stepUp.cjs.map +1 -0
- package/dist/web/lib/stepUp.d.mts +18 -0
- package/dist/web/lib/stepUp.d.mts.map +1 -0
- package/dist/web/lib/stepUp.mjs +41 -0
- package/dist/web/lib/stepUp.mjs.map +1 -0
- package/dist/web/lib/templateCatalog.cjs +123 -0
- package/dist/web/lib/templateCatalog.cjs.map +1 -0
- package/dist/web/lib/templateCatalog.d.mts +38 -0
- package/dist/web/lib/templateCatalog.d.mts.map +1 -0
- package/dist/web/lib/templateCatalog.mjs +118 -0
- package/dist/web/lib/templateCatalog.mjs.map +1 -0
- package/dist/web/lib/threadRenderer.cjs +25 -0
- package/dist/web/lib/threadRenderer.cjs.map +1 -0
- package/dist/web/lib/threadRenderer.d.mts +17 -0
- package/dist/web/lib/threadRenderer.d.mts.map +1 -0
- package/dist/web/lib/threadRenderer.mjs +23 -0
- package/dist/web/lib/threadRenderer.mjs.map +1 -0
- package/dist/web/lib/timelineGroups.cjs +83 -0
- package/dist/web/lib/timelineGroups.cjs.map +1 -0
- package/dist/web/lib/timelineGroups.d.mts +36 -0
- package/dist/web/lib/timelineGroups.d.mts.map +1 -0
- package/dist/web/lib/timelineGroups.mjs +81 -0
- package/dist/web/lib/timelineGroups.mjs.map +1 -0
- package/dist/web/lib/toolCompletionTabs.cjs +98 -0
- package/dist/web/lib/toolCompletionTabs.cjs.map +1 -0
- package/dist/web/lib/toolCompletionTabs.d.mts +14 -0
- package/dist/web/lib/toolCompletionTabs.d.mts.map +1 -0
- package/dist/web/lib/toolCompletionTabs.mjs +98 -0
- package/dist/web/lib/toolCompletionTabs.mjs.map +1 -0
- package/dist/web/lib/toolMessageProps.cjs +19 -0
- package/dist/web/lib/toolMessageProps.cjs.map +1 -0
- package/dist/web/lib/toolMessageProps.d.mts +7 -0
- package/dist/web/lib/toolMessageProps.d.mts.map +1 -0
- package/dist/web/lib/toolMessageProps.mjs +19 -0
- package/dist/web/lib/toolMessageProps.mjs.map +1 -0
- package/dist/web/lib/toolPrompt.cjs +44 -0
- package/dist/web/lib/toolPrompt.cjs.map +1 -0
- package/dist/web/lib/toolPrompt.d.mts +34 -0
- package/dist/web/lib/toolPrompt.d.mts.map +1 -0
- package/dist/web/lib/toolPrompt.mjs +44 -0
- package/dist/web/lib/toolPrompt.mjs.map +1 -0
- package/dist/web/lib/transport.cjs +57 -0
- package/dist/web/lib/transport.cjs.map +1 -0
- package/dist/web/lib/transport.d.mts +40 -0
- package/dist/web/lib/transport.d.mts.map +1 -0
- package/dist/web/lib/transport.mjs +50 -0
- package/dist/web/lib/transport.mjs.map +1 -0
- package/dist/web/lib/useSessionMcp.cjs +65 -0
- package/dist/web/lib/useSessionMcp.cjs.map +1 -0
- package/dist/web/lib/useSessionMcp.d.mts +15 -0
- package/dist/web/lib/useSessionMcp.d.mts.map +1 -0
- package/dist/web/lib/useSessionMcp.mjs +65 -0
- package/dist/web/lib/useSessionMcp.mjs.map +1 -0
- package/dist/web/lib/webauthnClient.cjs +110 -0
- package/dist/web/lib/webauthnClient.cjs.map +1 -0
- package/dist/web/lib/webauthnClient.d.mts +32 -0
- package/dist/web/lib/webauthnClient.d.mts.map +1 -0
- package/dist/web/lib/webauthnClient.mjs +106 -0
- package/dist/web/lib/webauthnClient.mjs.map +1 -0
- package/dist/web/lib/webmcpSimulator.cjs +105 -0
- package/dist/web/lib/webmcpSimulator.cjs.map +1 -0
- package/dist/web/lib/webmcpSimulator.mjs +105 -0
- package/dist/web/lib/webmcpSimulator.mjs.map +1 -0
- package/dist/web/stores/captureStore.cjs +137 -0
- package/dist/web/stores/captureStore.cjs.map +1 -0
- package/dist/web/stores/captureStore.d.mts +13 -0
- package/dist/web/stores/captureStore.d.mts.map +1 -0
- package/dist/web/stores/captureStore.mjs +133 -0
- package/dist/web/stores/captureStore.mjs.map +1 -0
- package/dist/web/stores/composerStore.cjs +390 -0
- package/dist/web/stores/composerStore.cjs.map +1 -0
- package/dist/web/stores/composerStore.d.mts +101 -0
- package/dist/web/stores/composerStore.d.mts.map +1 -0
- package/dist/web/stores/composerStore.mjs +370 -0
- package/dist/web/stores/composerStore.mjs.map +1 -0
- package/dist/web/stores/composerSubmissionStore.cjs +88 -0
- package/dist/web/stores/composerSubmissionStore.cjs.map +1 -0
- package/dist/web/stores/composerSubmissionStore.d.mts +11 -0
- package/dist/web/stores/composerSubmissionStore.d.mts.map +1 -0
- package/dist/web/stores/composerSubmissionStore.mjs +87 -0
- package/dist/web/stores/composerSubmissionStore.mjs.map +1 -0
- package/dist/web/stores/dashboardStateStore.cjs +35 -0
- package/dist/web/stores/dashboardStateStore.cjs.map +1 -0
- package/dist/web/stores/dashboardStateStore.d.mts +11 -0
- package/dist/web/stores/dashboardStateStore.d.mts.map +1 -0
- package/dist/web/stores/dashboardStateStore.mjs +33 -0
- package/dist/web/stores/dashboardStateStore.mjs.map +1 -0
- package/dist/web/stores/devProxyStore.cjs +76 -0
- package/dist/web/stores/devProxyStore.cjs.map +1 -0
- package/dist/web/stores/devProxyStore.d.mts +25 -0
- package/dist/web/stores/devProxyStore.d.mts.map +1 -0
- package/dist/web/stores/devProxyStore.mjs +73 -0
- package/dist/web/stores/devProxyStore.mjs.map +1 -0
- package/dist/web/stores/dialogDraftStore.cjs +38 -0
- package/dist/web/stores/dialogDraftStore.cjs.map +1 -0
- package/dist/web/stores/dialogDraftStore.d.mts +13 -0
- package/dist/web/stores/dialogDraftStore.d.mts.map +1 -0
- package/dist/web/stores/dialogDraftStore.mjs +36 -0
- package/dist/web/stores/dialogDraftStore.mjs.map +1 -0
- package/dist/web/stores/fileLinkModesStore.cjs +20 -0
- package/dist/web/stores/fileLinkModesStore.cjs.map +1 -0
- package/dist/web/stores/fileLinkModesStore.d.mts +5 -0
- package/dist/web/stores/fileLinkModesStore.d.mts.map +1 -0
- package/dist/web/stores/fileLinkModesStore.mjs +20 -0
- package/dist/web/stores/fileLinkModesStore.mjs.map +1 -0
- package/dist/web/stores/menuStore.cjs +85 -0
- package/dist/web/stores/menuStore.cjs.map +1 -0
- package/dist/web/stores/menuStore.d.mts +42 -0
- package/dist/web/stores/menuStore.d.mts.map +1 -0
- package/dist/web/stores/menuStore.mjs +79 -0
- package/dist/web/stores/menuStore.mjs.map +1 -0
- package/dist/web/stores/newSessionStore.cjs +93 -0
- package/dist/web/stores/newSessionStore.cjs.map +1 -0
- package/dist/web/stores/newSessionStore.d.mts +30 -0
- package/dist/web/stores/newSessionStore.d.mts.map +1 -0
- package/dist/web/stores/newSessionStore.mjs +86 -0
- package/dist/web/stores/newSessionStore.mjs.map +1 -0
- package/dist/web/stores/pagedTranscriptStore.cjs +235 -0
- package/dist/web/stores/pagedTranscriptStore.cjs.map +1 -0
- package/dist/web/stores/pagedTranscriptStore.d.mts +12 -0
- package/dist/web/stores/pagedTranscriptStore.d.mts.map +1 -0
- package/dist/web/stores/pagedTranscriptStore.mjs +235 -0
- package/dist/web/stores/pagedTranscriptStore.mjs.map +1 -0
- package/dist/web/stores/paletteStore.cjs +37 -0
- package/dist/web/stores/paletteStore.cjs.map +1 -0
- package/dist/web/stores/paletteStore.d.mts +14 -0
- package/dist/web/stores/paletteStore.d.mts.map +1 -0
- package/dist/web/stores/paletteStore.mjs +34 -0
- package/dist/web/stores/paletteStore.mjs.map +1 -0
- package/dist/web/stores/railDialogStore.cjs +105 -0
- package/dist/web/stores/railDialogStore.cjs.map +1 -0
- package/dist/web/stores/railDialogStore.d.mts +32 -0
- package/dist/web/stores/railDialogStore.d.mts.map +1 -0
- package/dist/web/stores/railDialogStore.mjs +97 -0
- package/dist/web/stores/railDialogStore.mjs.map +1 -0
- package/dist/web/stores/remoteAccessStore.cjs +216 -0
- package/dist/web/stores/remoteAccessStore.cjs.map +1 -0
- package/dist/web/stores/remoteAccessStore.d.mts +48 -0
- package/dist/web/stores/remoteAccessStore.d.mts.map +1 -0
- package/dist/web/stores/remoteAccessStore.mjs +202 -0
- package/dist/web/stores/remoteAccessStore.mjs.map +1 -0
- package/dist/web/stores/sessionChannelHoldsStore.cjs +43 -0
- package/dist/web/stores/sessionChannelHoldsStore.cjs.map +1 -0
- package/dist/web/stores/sessionChannelHoldsStore.d.mts +9 -0
- package/dist/web/stores/sessionChannelHoldsStore.d.mts.map +1 -0
- package/dist/web/stores/sessionChannelHoldsStore.mjs +42 -0
- package/dist/web/stores/sessionChannelHoldsStore.mjs.map +1 -0
- package/dist/web/stores/sessionStore.cjs +610 -0
- package/dist/web/stores/sessionStore.cjs.map +1 -0
- package/dist/web/stores/sessionStore.d.mts +116 -0
- package/dist/web/stores/sessionStore.d.mts.map +1 -0
- package/dist/web/stores/sessionStore.mjs +568 -0
- package/dist/web/stores/sessionStore.mjs.map +1 -0
- package/dist/web/stores/sessionsStore.cjs +272 -0
- package/dist/web/stores/sessionsStore.cjs.map +1 -0
- package/dist/web/stores/sessionsStore.d.mts +74 -0
- package/dist/web/stores/sessionsStore.d.mts.map +1 -0
- package/dist/web/stores/sessionsStore.mjs +257 -0
- package/dist/web/stores/sessionsStore.mjs.map +1 -0
- package/dist/web/stores/settingsDraftStore.cjs +138 -0
- package/dist/web/stores/settingsDraftStore.cjs.map +1 -0
- package/dist/web/stores/settingsDraftStore.d.mts +27 -0
- package/dist/web/stores/settingsDraftStore.d.mts.map +1 -0
- package/dist/web/stores/settingsDraftStore.mjs +132 -0
- package/dist/web/stores/settingsDraftStore.mjs.map +1 -0
- package/dist/web/stores/templateStore.cjs +136 -0
- package/dist/web/stores/templateStore.cjs.map +1 -0
- package/dist/web/stores/templateStore.d.mts +20 -0
- package/dist/web/stores/templateStore.d.mts.map +1 -0
- package/dist/web/stores/templateStore.mjs +131 -0
- package/dist/web/stores/templateStore.mjs.map +1 -0
- package/dist/web/stores/themeStore.cjs +42 -0
- package/dist/web/stores/themeStore.cjs.map +1 -0
- package/dist/web/stores/themeStore.d.mts +20 -0
- package/dist/web/stores/themeStore.d.mts.map +1 -0
- package/dist/web/stores/themeStore.mjs +39 -0
- package/dist/web/stores/themeStore.mjs.map +1 -0
- package/dist/web/stores/threadStore.cjs +122 -0
- package/dist/web/stores/threadStore.cjs.map +1 -0
- package/dist/web/stores/threadStore.d.mts +24 -0
- package/dist/web/stores/threadStore.d.mts.map +1 -0
- package/dist/web/stores/threadStore.mjs +114 -0
- package/dist/web/stores/threadStore.mjs.map +1 -0
- package/dist/web/stores/toolPromptStore.cjs +15 -0
- package/dist/web/stores/toolPromptStore.cjs.map +1 -0
- package/dist/web/stores/toolPromptStore.d.mts +23 -0
- package/dist/web/stores/toolPromptStore.d.mts.map +1 -0
- package/dist/web/stores/toolPromptStore.mjs +14 -0
- package/dist/web/stores/toolPromptStore.mjs.map +1 -0
- package/dist/web/stores/transientTabsStore.cjs +66 -0
- package/dist/web/stores/transientTabsStore.cjs.map +1 -0
- package/dist/web/stores/transientTabsStore.d.mts +21 -0
- package/dist/web/stores/transientTabsStore.d.mts.map +1 -0
- package/dist/web/stores/transientTabsStore.mjs +59 -0
- package/dist/web/stores/transientTabsStore.mjs.map +1 -0
- package/dist/web/stores/uiStore.cjs +47 -0
- package/dist/web/stores/uiStore.cjs.map +1 -0
- package/dist/web/stores/uiStore.d.mts +18 -0
- package/dist/web/stores/uiStore.d.mts.map +1 -0
- package/dist/web/stores/uiStore.mjs +45 -0
- package/dist/web/stores/uiStore.mjs.map +1 -0
- package/dist/web/stores/useOpenTab.cjs +31 -0
- package/dist/web/stores/useOpenTab.cjs.map +1 -0
- package/dist/web/stores/useOpenTab.d.mts +9 -0
- package/dist/web/stores/useOpenTab.d.mts.map +1 -0
- package/dist/web/stores/useOpenTab.mjs +31 -0
- package/dist/web/stores/useOpenTab.mjs.map +1 -0
- package/dist/web/stores/usePluginSlotProps.cjs +115 -0
- package/dist/web/stores/usePluginSlotProps.cjs.map +1 -0
- package/dist/web/stores/usePluginSlotProps.d.mts +6 -0
- package/dist/web/stores/usePluginSlotProps.d.mts.map +1 -0
- package/dist/web/stores/usePluginSlotProps.mjs +115 -0
- package/dist/web/stores/usePluginSlotProps.mjs.map +1 -0
- package/dist/web/stores/useToolPrompt.cjs +42 -0
- package/dist/web/stores/useToolPrompt.cjs.map +1 -0
- package/dist/web/stores/useToolPrompt.d.mts +14 -0
- package/dist/web/stores/useToolPrompt.d.mts.map +1 -0
- package/dist/web/stores/useToolPrompt.mjs +42 -0
- package/dist/web/stores/useToolPrompt.mjs.map +1 -0
- package/dist/web/stores/useWebPluginRegistry.cjs +11 -0
- package/dist/web/stores/useWebPluginRegistry.cjs.map +1 -0
- package/dist/web/stores/useWebPluginRegistry.d.mts +5 -0
- package/dist/web/stores/useWebPluginRegistry.d.mts.map +1 -0
- package/dist/web/stores/useWebPluginRegistry.mjs +11 -0
- package/dist/web/stores/useWebPluginRegistry.mjs.map +1 -0
- package/dist/web/stores/workspaceAdmissionStore.cjs +67 -0
- package/dist/web/stores/workspaceAdmissionStore.cjs.map +1 -0
- package/dist/web/stores/workspaceAdmissionStore.d.mts +24 -0
- package/dist/web/stores/workspaceAdmissionStore.d.mts.map +1 -0
- package/dist/web/stores/workspaceAdmissionStore.mjs +64 -0
- package/dist/web/stores/workspaceAdmissionStore.mjs.map +1 -0
- package/dist/web/stores/workspacesStore.cjs +83 -0
- package/dist/web/stores/workspacesStore.cjs.map +1 -0
- package/dist/web/stores/workspacesStore.d.mts +17 -0
- package/dist/web/stores/workspacesStore.d.mts.map +1 -0
- package/dist/web/stores/workspacesStore.mjs +78 -0
- package/dist/web/stores/workspacesStore.mjs.map +1 -0
- package/llms.txt +3 -0
- package/package.json +107 -0
- package/styles/dashboard.css +2 -0
- package/styles/preview.css +3 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
//#region src/web/lib/leaderTree.ts
|
|
2
|
+
const ROOT_LABEL = "leader";
|
|
3
|
+
/**
|
|
4
|
+
* Inserts one binding the way the TUI registry does: a group segment keeps
|
|
5
|
+
* the label of whoever registered it first (adopting a detail if it had
|
|
6
|
+
* none), and a leaf that is already bound is taken over by the newcomer,
|
|
7
|
+
* along with any group that stood where the leaf now goes.
|
|
8
|
+
*/
|
|
9
|
+
function insert(root, binding) {
|
|
10
|
+
let current = root;
|
|
11
|
+
for (const [index, segment] of binding.path.entries()) {
|
|
12
|
+
const isLeaf = index === binding.path.length - 1;
|
|
13
|
+
let node = current.children.get(segment.key);
|
|
14
|
+
if (!node) {
|
|
15
|
+
node = {
|
|
16
|
+
key: segment.key,
|
|
17
|
+
label: segment.label,
|
|
18
|
+
detail: segment.detail ?? "",
|
|
19
|
+
children: /* @__PURE__ */ new Map()
|
|
20
|
+
};
|
|
21
|
+
current.children.set(segment.key, node);
|
|
22
|
+
} else if (!node.detail && segment.detail) node.detail = segment.detail;
|
|
23
|
+
if (isLeaf) {
|
|
24
|
+
node.children.clear();
|
|
25
|
+
node.binding = binding;
|
|
26
|
+
node.label = segment.label;
|
|
27
|
+
node.detail = segment.detail ?? "";
|
|
28
|
+
} else if (node.binding) delete node.binding;
|
|
29
|
+
current = node;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function leavesUnder(node) {
|
|
33
|
+
const leaves = [];
|
|
34
|
+
if (node.binding) leaves.push(node.binding);
|
|
35
|
+
for (const child of node.children.values()) leaves.push(...leavesUnder(child));
|
|
36
|
+
return leaves;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Every place `insert` would silently prefer one binding over another, in
|
|
40
|
+
* the same order insert walks them: a leaf landing on a bound leaf or over a
|
|
41
|
+
* group displaces those bindings, a group segment crossing a bound leaf
|
|
42
|
+
* displaces it, and a group segment worded differently from the first namer
|
|
43
|
+
* keeps the first wording.
|
|
44
|
+
*/
|
|
45
|
+
function leaderConflicts(bindings) {
|
|
46
|
+
const conflicts = [];
|
|
47
|
+
const root = {
|
|
48
|
+
key: "",
|
|
49
|
+
label: ROOT_LABEL,
|
|
50
|
+
detail: "",
|
|
51
|
+
children: /* @__PURE__ */ new Map()
|
|
52
|
+
};
|
|
53
|
+
const namers = /* @__PURE__ */ new Map();
|
|
54
|
+
for (const binding of bindings) {
|
|
55
|
+
let current = root;
|
|
56
|
+
const keys = [];
|
|
57
|
+
for (const [index, segment] of binding.path.entries()) {
|
|
58
|
+
keys.push(segment.key);
|
|
59
|
+
const path = keys.join(" ");
|
|
60
|
+
const isLeaf = index === binding.path.length - 1;
|
|
61
|
+
let node = current.children.get(segment.key);
|
|
62
|
+
if (node) {
|
|
63
|
+
if (isLeaf) {
|
|
64
|
+
for (const loser of leavesUnder(node)) if (loser !== binding) conflicts.push({
|
|
65
|
+
kind: "leaf-override",
|
|
66
|
+
path,
|
|
67
|
+
winner: binding,
|
|
68
|
+
loser
|
|
69
|
+
});
|
|
70
|
+
} else {
|
|
71
|
+
if (node.binding && node.binding !== binding) conflicts.push({
|
|
72
|
+
kind: "leaf-override",
|
|
73
|
+
path,
|
|
74
|
+
winner: binding,
|
|
75
|
+
loser: node.binding
|
|
76
|
+
});
|
|
77
|
+
const namer = namers.get(node);
|
|
78
|
+
if (namer !== void 0 && namer !== binding && node.label !== segment.label) conflicts.push({
|
|
79
|
+
kind: "group-label",
|
|
80
|
+
path,
|
|
81
|
+
winner: namer,
|
|
82
|
+
loser: binding
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
node = {
|
|
87
|
+
key: segment.key,
|
|
88
|
+
label: segment.label,
|
|
89
|
+
detail: "",
|
|
90
|
+
children: /* @__PURE__ */ new Map()
|
|
91
|
+
};
|
|
92
|
+
current.children.set(segment.key, node);
|
|
93
|
+
namers.set(node, binding);
|
|
94
|
+
}
|
|
95
|
+
if (isLeaf) {
|
|
96
|
+
node.children.clear();
|
|
97
|
+
node.binding = binding;
|
|
98
|
+
node.label = segment.label;
|
|
99
|
+
namers.set(node, binding);
|
|
100
|
+
} else if (node.binding) delete node.binding;
|
|
101
|
+
current = node;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return conflicts;
|
|
105
|
+
}
|
|
106
|
+
function toOption(node) {
|
|
107
|
+
const children = [...node.children.values()].sort((left, right) => left.key.localeCompare(right.key)).map((child) => ({
|
|
108
|
+
key: child.key,
|
|
109
|
+
label: child.label,
|
|
110
|
+
detail: child.detail,
|
|
111
|
+
children: []
|
|
112
|
+
}));
|
|
113
|
+
return {
|
|
114
|
+
key: node.key,
|
|
115
|
+
label: node.label,
|
|
116
|
+
detail: node.detail,
|
|
117
|
+
...node.binding ? { binding: node.binding } : {},
|
|
118
|
+
children
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The options one level of Leader Space offers, keyed by what the reader
|
|
123
|
+
* would press, sorted by key. Undefined when the path runs off the tree or
|
|
124
|
+
* lands on a leaf, which is how the palette knows a path is no longer a group.
|
|
125
|
+
*/
|
|
126
|
+
function leaderGroup(bindings, path) {
|
|
127
|
+
const root = {
|
|
128
|
+
key: "",
|
|
129
|
+
label: ROOT_LABEL,
|
|
130
|
+
detail: "",
|
|
131
|
+
children: /* @__PURE__ */ new Map()
|
|
132
|
+
};
|
|
133
|
+
for (const binding of bindings) insert(root, binding);
|
|
134
|
+
let current = root;
|
|
135
|
+
for (const key of path) {
|
|
136
|
+
const next = current.children.get(key);
|
|
137
|
+
if (!next || next.binding) return void 0;
|
|
138
|
+
current = next;
|
|
139
|
+
}
|
|
140
|
+
const options = [...current.children.values()].sort((left, right) => left.key.localeCompare(right.key)).map(toOption);
|
|
141
|
+
return {
|
|
142
|
+
label: current.label,
|
|
143
|
+
options
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
147
|
+
export { leaderConflicts, leaderGroup };
|
|
148
|
+
|
|
149
|
+
//# sourceMappingURL=leaderTree.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leaderTree.mjs","names":[],"sources":["../../../src/web/lib/leaderTree.ts"],"sourcesContent":["import type { LeaderBindingContribution } from '@agimon-ai/po-core/web';\n\nexport interface LeaderOption {\n key: string;\n label: string;\n detail: string;\n /** A group opens the next level; a leaf carries the binding that fires. */\n binding?: LeaderBindingContribution;\n /** The keys one level down, for a group's preview; empty for a leaf. */\n children: LeaderOption[];\n}\n\nexport interface LeaderGroup {\n /** The label of the segment that opened this level; 'leader' at the root. */\n label: string;\n options: LeaderOption[];\n}\n\ninterface LeaderNode {\n key: string;\n label: string;\n detail: string;\n binding?: LeaderBindingContribution;\n children: Map<string, LeaderNode>;\n}\n\nconst ROOT_LABEL = 'leader';\n\n/**\n * Inserts one binding the way the TUI registry does: a group segment keeps\n * the label of whoever registered it first (adopting a detail if it had\n * none), and a leaf that is already bound is taken over by the newcomer,\n * along with any group that stood where the leaf now goes.\n */\nfunction insert(root: LeaderNode, binding: LeaderBindingContribution): void {\n let current = root;\n for (const [index, segment] of binding.path.entries()) {\n const isLeaf = index === binding.path.length - 1;\n let node = current.children.get(segment.key);\n if (!node) {\n node = { key: segment.key, label: segment.label, detail: segment.detail ?? '', children: new Map() };\n current.children.set(segment.key, node);\n } else if (!node.detail && segment.detail) {\n node.detail = segment.detail;\n }\n if (isLeaf) {\n node.children.clear();\n node.binding = binding;\n node.label = segment.label;\n node.detail = segment.detail ?? '';\n } else if (node.binding) {\n delete node.binding;\n }\n current = node;\n }\n}\n\nexport interface LeaderConflict {\n /** A later binding took a bound leaf (or a whole group) over, or a group segment was worded differently. */\n kind: 'leaf-override' | 'group-label';\n /** The keys of the contested segment, space separated. */\n path: string;\n /** The binding the tree keeps: the later one for a leaf, the first namer for a group label. */\n winner: LeaderBindingContribution;\n loser: LeaderBindingContribution;\n}\n\nfunction leavesUnder(node: LeaderNode): LeaderBindingContribution[] {\n const leaves: LeaderBindingContribution[] = [];\n if (node.binding) leaves.push(node.binding);\n for (const child of node.children.values()) leaves.push(...leavesUnder(child));\n return leaves;\n}\n\n/**\n * Every place `insert` would silently prefer one binding over another, in\n * the same order insert walks them: a leaf landing on a bound leaf or over a\n * group displaces those bindings, a group segment crossing a bound leaf\n * displaces it, and a group segment worded differently from the first namer\n * keeps the first wording.\n */\nexport function leaderConflicts(bindings: readonly LeaderBindingContribution[]): LeaderConflict[] {\n const conflicts: LeaderConflict[] = [];\n const root: LeaderNode = { key: '', label: ROOT_LABEL, detail: '', children: new Map() };\n const namers = new Map<LeaderNode, LeaderBindingContribution>();\n for (const binding of bindings) {\n let current = root;\n const keys: string[] = [];\n for (const [index, segment] of binding.path.entries()) {\n keys.push(segment.key);\n const path = keys.join(' ');\n const isLeaf = index === binding.path.length - 1;\n let node = current.children.get(segment.key);\n if (node) {\n if (isLeaf) {\n for (const loser of leavesUnder(node)) {\n if (loser !== binding) conflicts.push({ kind: 'leaf-override', path, winner: binding, loser });\n }\n } else {\n if (node.binding && node.binding !== binding) {\n conflicts.push({ kind: 'leaf-override', path, winner: binding, loser: node.binding });\n }\n const namer = namers.get(node);\n if (namer !== undefined && namer !== binding && node.label !== segment.label) {\n conflicts.push({ kind: 'group-label', path, winner: namer, loser: binding });\n }\n }\n } else {\n node = { key: segment.key, label: segment.label, detail: '', children: new Map() };\n current.children.set(segment.key, node);\n namers.set(node, binding);\n }\n if (isLeaf) {\n node.children.clear();\n node.binding = binding;\n node.label = segment.label;\n namers.set(node, binding);\n } else if (node.binding) {\n delete node.binding;\n }\n current = node;\n }\n }\n return conflicts;\n}\n\nfunction toOption(node: LeaderNode): LeaderOption {\n const children = [...node.children.values()]\n .sort((left, right) => left.key.localeCompare(right.key))\n .map((child) => ({ key: child.key, label: child.label, detail: child.detail, children: [] }));\n return {\n key: node.key,\n label: node.label,\n detail: node.detail,\n ...(node.binding ? { binding: node.binding } : {}),\n children,\n };\n}\n\n/**\n * The options one level of Leader Space offers, keyed by what the reader\n * would press, sorted by key. Undefined when the path runs off the tree or\n * lands on a leaf, which is how the palette knows a path is no longer a group.\n */\nexport function leaderGroup(\n bindings: readonly LeaderBindingContribution[],\n path: readonly string[],\n): LeaderGroup | undefined {\n const root: LeaderNode = { key: '', label: ROOT_LABEL, detail: '', children: new Map() };\n for (const binding of bindings) insert(root, binding);\n let current = root;\n for (const key of path) {\n const next = current.children.get(key);\n if (!next || next.binding) return undefined;\n current = next;\n }\n const options = [...current.children.values()].sort((left, right) => left.key.localeCompare(right.key)).map(toOption);\n return { label: current.label, options };\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const require_remoteAccess = require("../../types/remoteAccess.cjs");
|
|
2
|
+
const require_sealedSession = require("./sealedSession.cjs");
|
|
3
|
+
//#region src/web/lib/livePush.ts
|
|
4
|
+
function supported() {
|
|
5
|
+
return "serviceWorker" in navigator && "PushManager" in window && typeof Notification !== "undefined" && typeof ServiceWorkerRegistration.prototype.showNotification === "function";
|
|
6
|
+
}
|
|
7
|
+
function base64UrlBytes(value) {
|
|
8
|
+
const normalized = value.replaceAll("-", "+").replaceAll("_", "/");
|
|
9
|
+
const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, "=");
|
|
10
|
+
return Uint8Array.from(atob(padded), (character) => character.charCodeAt(0));
|
|
11
|
+
}
|
|
12
|
+
function sameKey(left, right) {
|
|
13
|
+
if (left === null) return false;
|
|
14
|
+
const bytes = new Uint8Array(left);
|
|
15
|
+
return bytes.length === right.length && bytes.every((value, index) => value === right[index]);
|
|
16
|
+
}
|
|
17
|
+
async function applicationServerKey() {
|
|
18
|
+
const response = await require_sealedSession.sealedHttpSession.fetch(require_remoteAccess.REMOTE_PUSH_KEY_ROUTE, { cache: "no-store" });
|
|
19
|
+
if (!response.ok) return void 0;
|
|
20
|
+
const body = await response.json();
|
|
21
|
+
if (typeof body !== "object" || body === null || !("publicKey" in body) || typeof body.publicKey !== "string") return;
|
|
22
|
+
try {
|
|
23
|
+
return base64UrlBytes(body.publicKey);
|
|
24
|
+
} catch {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async function registerSubscription(registration, applicationKey) {
|
|
29
|
+
let subscription = await registration.pushManager.getSubscription();
|
|
30
|
+
if (subscription !== null && !sameKey(subscription.options.applicationServerKey, applicationKey)) {
|
|
31
|
+
await subscription.unsubscribe();
|
|
32
|
+
subscription = null;
|
|
33
|
+
}
|
|
34
|
+
subscription ??= await registration.pushManager.subscribe({
|
|
35
|
+
userVisibleOnly: true,
|
|
36
|
+
applicationServerKey: applicationKey
|
|
37
|
+
});
|
|
38
|
+
if ((await require_sealedSession.sealedHttpSession.fetch(require_remoteAccess.REMOTE_PUSH_ROUTE, {
|
|
39
|
+
method: "POST",
|
|
40
|
+
headers: { "Content-Type": "application/json" },
|
|
41
|
+
body: JSON.stringify(subscription.toJSON())
|
|
42
|
+
})).ok) return true;
|
|
43
|
+
await subscription.unsubscribe();
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
async function livePushStatus() {
|
|
47
|
+
if (!supported()) return "unsupported";
|
|
48
|
+
if (Notification.permission === "denied") return "denied";
|
|
49
|
+
if (Notification.permission !== "granted") return "disabled";
|
|
50
|
+
try {
|
|
51
|
+
return await (await navigator.serviceWorker.ready).pushManager.getSubscription() === null ? "disabled" : "enabled";
|
|
52
|
+
} catch {
|
|
53
|
+
return "error";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Enables a browser-owned subscription, retained only in memory by the live host. */
|
|
57
|
+
async function enableLivePush() {
|
|
58
|
+
if (!supported()) return "unsupported";
|
|
59
|
+
try {
|
|
60
|
+
const permission = Notification.permission === "granted" ? "granted" : await Notification.requestPermission();
|
|
61
|
+
if (permission !== "granted") return permission === "denied" ? "denied" : "disabled";
|
|
62
|
+
const [registration, applicationKey] = await Promise.all([navigator.serviceWorker.ready, applicationServerKey()]);
|
|
63
|
+
if (applicationKey === void 0) return "error";
|
|
64
|
+
return await registerSubscription(registration, applicationKey) ? "enabled" : "error";
|
|
65
|
+
} catch {
|
|
66
|
+
return "error";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async function disableLivePush() {
|
|
70
|
+
if (!supported()) return "unsupported";
|
|
71
|
+
try {
|
|
72
|
+
const subscription = await (await navigator.serviceWorker.ready).pushManager.getSubscription();
|
|
73
|
+
const response = await require_sealedSession.sealedHttpSession.fetch(require_remoteAccess.REMOTE_PUSH_ROUTE, { method: "DELETE" });
|
|
74
|
+
await subscription?.unsubscribe();
|
|
75
|
+
return response.ok ? "disabled" : "error";
|
|
76
|
+
} catch {
|
|
77
|
+
return "error";
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/** Re-registers a persisted browser subscription after the host process restarts. */
|
|
81
|
+
async function restoreLivePushRegistration() {
|
|
82
|
+
if (!supported() || Notification.permission !== "granted") return;
|
|
83
|
+
try {
|
|
84
|
+
const registration = await navigator.serviceWorker.ready;
|
|
85
|
+
if (await registration.pushManager.getSubscription() === null) return;
|
|
86
|
+
const applicationKey = await applicationServerKey();
|
|
87
|
+
if (applicationKey === void 0) return;
|
|
88
|
+
await registerSubscription(registration, applicationKey);
|
|
89
|
+
} catch {}
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
exports.disableLivePush = disableLivePush;
|
|
93
|
+
exports.enableLivePush = enableLivePush;
|
|
94
|
+
exports.livePushStatus = livePushStatus;
|
|
95
|
+
exports.restoreLivePushRegistration = restoreLivePushRegistration;
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=livePush.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"livePush.cjs","names":["sealedHttpSession","REMOTE_PUSH_KEY_ROUTE","REMOTE_PUSH_ROUTE"],"sources":["../../../src/web/lib/livePush.ts"],"sourcesContent":["import { REMOTE_PUSH_KEY_ROUTE, REMOTE_PUSH_ROUTE } from '../../types/remoteAccess';\nimport { sealedHttpSession } from './sealedSession';\n\nexport type LivePushStatus = 'enabled' | 'disabled' | 'denied' | 'unsupported' | 'error';\n\nfunction supported(): boolean {\n return (\n 'serviceWorker' in navigator &&\n 'PushManager' in window &&\n typeof Notification !== 'undefined' &&\n typeof ServiceWorkerRegistration.prototype.showNotification === 'function'\n );\n}\n\nfunction base64UrlBytes(value: string): Uint8Array<ArrayBuffer> {\n const normalized = value.replaceAll('-', '+').replaceAll('_', '/');\n const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, '=');\n return Uint8Array.from(atob(padded), (character) => character.charCodeAt(0));\n}\n\nfunction sameKey(left: ArrayBuffer | null, right: Uint8Array<ArrayBuffer>): boolean {\n if (left === null) return false;\n const bytes = new Uint8Array(left);\n return bytes.length === right.length && bytes.every((value, index) => value === right[index]);\n}\n\nasync function applicationServerKey(): Promise<Uint8Array<ArrayBuffer> | undefined> {\n const response = await sealedHttpSession.fetch(REMOTE_PUSH_KEY_ROUTE, { cache: 'no-store' });\n if (!response.ok) return undefined;\n const body: unknown = await response.json();\n if (typeof body !== 'object' || body === null || !('publicKey' in body) || typeof body.publicKey !== 'string') {\n return undefined;\n }\n try {\n return base64UrlBytes(body.publicKey);\n } catch {\n return undefined;\n }\n}\n\nasync function registerSubscription(\n registration: ServiceWorkerRegistration,\n applicationKey: Uint8Array<ArrayBuffer>,\n): Promise<boolean> {\n let subscription = await registration.pushManager.getSubscription();\n if (subscription !== null && !sameKey(subscription.options.applicationServerKey, applicationKey)) {\n await subscription.unsubscribe();\n subscription = null;\n }\n subscription ??= await registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: applicationKey,\n });\n const response = await sealedHttpSession.fetch(REMOTE_PUSH_ROUTE, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(subscription.toJSON()),\n });\n if (response.ok) return true;\n await subscription.unsubscribe();\n return false;\n}\n\nexport async function livePushStatus(): Promise<LivePushStatus> {\n if (!supported()) return 'unsupported';\n if (Notification.permission === 'denied') return 'denied';\n if (Notification.permission !== 'granted') return 'disabled';\n try {\n const registration = await navigator.serviceWorker.ready;\n return (await registration.pushManager.getSubscription()) === null ? 'disabled' : 'enabled';\n } catch {\n return 'error';\n }\n}\n\n/** Enables a browser-owned subscription, retained only in memory by the live host. */\nexport async function enableLivePush(): Promise<LivePushStatus> {\n if (!supported()) return 'unsupported';\n try {\n const permission = Notification.permission === 'granted' ? 'granted' : await Notification.requestPermission();\n if (permission !== 'granted') return permission === 'denied' ? 'denied' : 'disabled';\n const [registration, applicationKey] = await Promise.all([navigator.serviceWorker.ready, applicationServerKey()]);\n if (applicationKey === undefined) return 'error';\n return (await registerSubscription(registration, applicationKey)) ? 'enabled' : 'error';\n } catch {\n return 'error';\n }\n}\n\nexport async function disableLivePush(): Promise<LivePushStatus> {\n if (!supported()) return 'unsupported';\n try {\n const registration = await navigator.serviceWorker.ready;\n const subscription = await registration.pushManager.getSubscription();\n const response = await sealedHttpSession.fetch(REMOTE_PUSH_ROUTE, { method: 'DELETE' });\n await subscription?.unsubscribe();\n return response.ok ? 'disabled' : 'error';\n } catch {\n return 'error';\n }\n}\n\n/** Re-registers a persisted browser subscription after the host process restarts. */\nexport async function restoreLivePushRegistration(): Promise<void> {\n if (!supported() || Notification.permission !== 'granted') return;\n try {\n const registration = await navigator.serviceWorker.ready;\n const existing = await registration.pushManager.getSubscription();\n if (existing === null) return;\n const applicationKey = await applicationServerKey();\n if (applicationKey === undefined) return;\n await registerSubscription(registration, applicationKey);\n } catch {\n // Registration is opportunistic. The explicit settings action reports errors.\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/web/lib/livePush.d.ts
|
|
2
|
+
export type LivePushStatus = 'enabled' | 'disabled' | 'denied' | 'unsupported' | 'error';
|
|
3
|
+
export declare function livePushStatus(): Promise<LivePushStatus>;
|
|
4
|
+
/** Enables a browser-owned subscription, retained only in memory by the live host. */
|
|
5
|
+
export declare function enableLivePush(): Promise<LivePushStatus>;
|
|
6
|
+
export declare function disableLivePush(): Promise<LivePushStatus>;
|
|
7
|
+
/** Re-registers a persisted browser subscription after the host process restarts. */
|
|
8
|
+
export declare function restoreLivePushRegistration(): Promise<void>;
|
|
9
|
+
//#endregion
|
|
10
|
+
//# sourceMappingURL=livePush.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"livePush.d.mts","names":[],"sources":["../../../src/web/lib/livePush.ts"],"mappings":";YAGY;wBA4DU,kBAAkB,QAAQ;;wBAa1B,kBAAkB,QAAQ;wBAa1B,mBAAmB,QAAQ;;wBAc3B,+BAA+B"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { REMOTE_PUSH_KEY_ROUTE, REMOTE_PUSH_ROUTE } from "../../types/remoteAccess.mjs";
|
|
2
|
+
import { sealedHttpSession } from "./sealedSession.mjs";
|
|
3
|
+
//#region src/web/lib/livePush.ts
|
|
4
|
+
function supported() {
|
|
5
|
+
return "serviceWorker" in navigator && "PushManager" in window && typeof Notification !== "undefined" && typeof ServiceWorkerRegistration.prototype.showNotification === "function";
|
|
6
|
+
}
|
|
7
|
+
function base64UrlBytes(value) {
|
|
8
|
+
const normalized = value.replaceAll("-", "+").replaceAll("_", "/");
|
|
9
|
+
const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, "=");
|
|
10
|
+
return Uint8Array.from(atob(padded), (character) => character.charCodeAt(0));
|
|
11
|
+
}
|
|
12
|
+
function sameKey(left, right) {
|
|
13
|
+
if (left === null) return false;
|
|
14
|
+
const bytes = new Uint8Array(left);
|
|
15
|
+
return bytes.length === right.length && bytes.every((value, index) => value === right[index]);
|
|
16
|
+
}
|
|
17
|
+
async function applicationServerKey() {
|
|
18
|
+
const response = await sealedHttpSession.fetch(REMOTE_PUSH_KEY_ROUTE, { cache: "no-store" });
|
|
19
|
+
if (!response.ok) return void 0;
|
|
20
|
+
const body = await response.json();
|
|
21
|
+
if (typeof body !== "object" || body === null || !("publicKey" in body) || typeof body.publicKey !== "string") return;
|
|
22
|
+
try {
|
|
23
|
+
return base64UrlBytes(body.publicKey);
|
|
24
|
+
} catch {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async function registerSubscription(registration, applicationKey) {
|
|
29
|
+
let subscription = await registration.pushManager.getSubscription();
|
|
30
|
+
if (subscription !== null && !sameKey(subscription.options.applicationServerKey, applicationKey)) {
|
|
31
|
+
await subscription.unsubscribe();
|
|
32
|
+
subscription = null;
|
|
33
|
+
}
|
|
34
|
+
subscription ??= await registration.pushManager.subscribe({
|
|
35
|
+
userVisibleOnly: true,
|
|
36
|
+
applicationServerKey: applicationKey
|
|
37
|
+
});
|
|
38
|
+
if ((await sealedHttpSession.fetch(REMOTE_PUSH_ROUTE, {
|
|
39
|
+
method: "POST",
|
|
40
|
+
headers: { "Content-Type": "application/json" },
|
|
41
|
+
body: JSON.stringify(subscription.toJSON())
|
|
42
|
+
})).ok) return true;
|
|
43
|
+
await subscription.unsubscribe();
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
async function livePushStatus() {
|
|
47
|
+
if (!supported()) return "unsupported";
|
|
48
|
+
if (Notification.permission === "denied") return "denied";
|
|
49
|
+
if (Notification.permission !== "granted") return "disabled";
|
|
50
|
+
try {
|
|
51
|
+
return await (await navigator.serviceWorker.ready).pushManager.getSubscription() === null ? "disabled" : "enabled";
|
|
52
|
+
} catch {
|
|
53
|
+
return "error";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Enables a browser-owned subscription, retained only in memory by the live host. */
|
|
57
|
+
async function enableLivePush() {
|
|
58
|
+
if (!supported()) return "unsupported";
|
|
59
|
+
try {
|
|
60
|
+
const permission = Notification.permission === "granted" ? "granted" : await Notification.requestPermission();
|
|
61
|
+
if (permission !== "granted") return permission === "denied" ? "denied" : "disabled";
|
|
62
|
+
const [registration, applicationKey] = await Promise.all([navigator.serviceWorker.ready, applicationServerKey()]);
|
|
63
|
+
if (applicationKey === void 0) return "error";
|
|
64
|
+
return await registerSubscription(registration, applicationKey) ? "enabled" : "error";
|
|
65
|
+
} catch {
|
|
66
|
+
return "error";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async function disableLivePush() {
|
|
70
|
+
if (!supported()) return "unsupported";
|
|
71
|
+
try {
|
|
72
|
+
const subscription = await (await navigator.serviceWorker.ready).pushManager.getSubscription();
|
|
73
|
+
const response = await sealedHttpSession.fetch(REMOTE_PUSH_ROUTE, { method: "DELETE" });
|
|
74
|
+
await subscription?.unsubscribe();
|
|
75
|
+
return response.ok ? "disabled" : "error";
|
|
76
|
+
} catch {
|
|
77
|
+
return "error";
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/** Re-registers a persisted browser subscription after the host process restarts. */
|
|
81
|
+
async function restoreLivePushRegistration() {
|
|
82
|
+
if (!supported() || Notification.permission !== "granted") return;
|
|
83
|
+
try {
|
|
84
|
+
const registration = await navigator.serviceWorker.ready;
|
|
85
|
+
if (await registration.pushManager.getSubscription() === null) return;
|
|
86
|
+
const applicationKey = await applicationServerKey();
|
|
87
|
+
if (applicationKey === void 0) return;
|
|
88
|
+
await registerSubscription(registration, applicationKey);
|
|
89
|
+
} catch {}
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { disableLivePush, enableLivePush, livePushStatus, restoreLivePushRegistration };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=livePush.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"livePush.mjs","names":[],"sources":["../../../src/web/lib/livePush.ts"],"sourcesContent":["import { REMOTE_PUSH_KEY_ROUTE, REMOTE_PUSH_ROUTE } from '../../types/remoteAccess';\nimport { sealedHttpSession } from './sealedSession';\n\nexport type LivePushStatus = 'enabled' | 'disabled' | 'denied' | 'unsupported' | 'error';\n\nfunction supported(): boolean {\n return (\n 'serviceWorker' in navigator &&\n 'PushManager' in window &&\n typeof Notification !== 'undefined' &&\n typeof ServiceWorkerRegistration.prototype.showNotification === 'function'\n );\n}\n\nfunction base64UrlBytes(value: string): Uint8Array<ArrayBuffer> {\n const normalized = value.replaceAll('-', '+').replaceAll('_', '/');\n const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, '=');\n return Uint8Array.from(atob(padded), (character) => character.charCodeAt(0));\n}\n\nfunction sameKey(left: ArrayBuffer | null, right: Uint8Array<ArrayBuffer>): boolean {\n if (left === null) return false;\n const bytes = new Uint8Array(left);\n return bytes.length === right.length && bytes.every((value, index) => value === right[index]);\n}\n\nasync function applicationServerKey(): Promise<Uint8Array<ArrayBuffer> | undefined> {\n const response = await sealedHttpSession.fetch(REMOTE_PUSH_KEY_ROUTE, { cache: 'no-store' });\n if (!response.ok) return undefined;\n const body: unknown = await response.json();\n if (typeof body !== 'object' || body === null || !('publicKey' in body) || typeof body.publicKey !== 'string') {\n return undefined;\n }\n try {\n return base64UrlBytes(body.publicKey);\n } catch {\n return undefined;\n }\n}\n\nasync function registerSubscription(\n registration: ServiceWorkerRegistration,\n applicationKey: Uint8Array<ArrayBuffer>,\n): Promise<boolean> {\n let subscription = await registration.pushManager.getSubscription();\n if (subscription !== null && !sameKey(subscription.options.applicationServerKey, applicationKey)) {\n await subscription.unsubscribe();\n subscription = null;\n }\n subscription ??= await registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: applicationKey,\n });\n const response = await sealedHttpSession.fetch(REMOTE_PUSH_ROUTE, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(subscription.toJSON()),\n });\n if (response.ok) return true;\n await subscription.unsubscribe();\n return false;\n}\n\nexport async function livePushStatus(): Promise<LivePushStatus> {\n if (!supported()) return 'unsupported';\n if (Notification.permission === 'denied') return 'denied';\n if (Notification.permission !== 'granted') return 'disabled';\n try {\n const registration = await navigator.serviceWorker.ready;\n return (await registration.pushManager.getSubscription()) === null ? 'disabled' : 'enabled';\n } catch {\n return 'error';\n }\n}\n\n/** Enables a browser-owned subscription, retained only in memory by the live host. */\nexport async function enableLivePush(): Promise<LivePushStatus> {\n if (!supported()) return 'unsupported';\n try {\n const permission = Notification.permission === 'granted' ? 'granted' : await Notification.requestPermission();\n if (permission !== 'granted') return permission === 'denied' ? 'denied' : 'disabled';\n const [registration, applicationKey] = await Promise.all([navigator.serviceWorker.ready, applicationServerKey()]);\n if (applicationKey === undefined) return 'error';\n return (await registerSubscription(registration, applicationKey)) ? 'enabled' : 'error';\n } catch {\n return 'error';\n }\n}\n\nexport async function disableLivePush(): Promise<LivePushStatus> {\n if (!supported()) return 'unsupported';\n try {\n const registration = await navigator.serviceWorker.ready;\n const subscription = await registration.pushManager.getSubscription();\n const response = await sealedHttpSession.fetch(REMOTE_PUSH_ROUTE, { method: 'DELETE' });\n await subscription?.unsubscribe();\n return response.ok ? 'disabled' : 'error';\n } catch {\n return 'error';\n }\n}\n\n/** Re-registers a persisted browser subscription after the host process restarts. */\nexport async function restoreLivePushRegistration(): Promise<void> {\n if (!supported() || Notification.permission !== 'granted') return;\n try {\n const registration = await navigator.serviceWorker.ready;\n const existing = await registration.pushManager.getSubscription();\n if (existing === null) return;\n const applicationKey = await applicationServerKey();\n if (applicationKey === undefined) return;\n await registerSubscription(registration, applicationKey);\n } catch {\n // Registration is opportunistic. The explicit settings action reports errors.\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//#region src/web/lib/modelContextAdapter.ts
|
|
2
|
+
let bindingPromise;
|
|
3
|
+
let simulator;
|
|
4
|
+
let generation = 0;
|
|
5
|
+
function hasMethod(value, name) {
|
|
6
|
+
return typeof value[name] === "function";
|
|
7
|
+
}
|
|
8
|
+
function isCompleteModelContext(value) {
|
|
9
|
+
if (typeof value !== "object" || value === null) return false;
|
|
10
|
+
return hasMethod(value, "registerTool") && hasMethod(value, "getTools") && hasMethod(value, "executeTool") && hasMethod(value, "addEventListener") && hasMethod(value, "removeEventListener");
|
|
11
|
+
}
|
|
12
|
+
function cloneDescriptor(descriptor) {
|
|
13
|
+
return {
|
|
14
|
+
name: descriptor.name,
|
|
15
|
+
description: descriptor.description,
|
|
16
|
+
inputSchema: structuredClone(descriptor.inputSchema)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function bindNative(modelContext) {
|
|
20
|
+
return {
|
|
21
|
+
registerTool: modelContext.registerTool.bind(modelContext),
|
|
22
|
+
getTools: async () => (await modelContext.getTools()).map(cloneDescriptor),
|
|
23
|
+
executeTool: modelContext.executeTool.bind(modelContext),
|
|
24
|
+
addEventListener: modelContext.addEventListener.bind(modelContext),
|
|
25
|
+
removeEventListener: modelContext.removeEventListener.bind(modelContext)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function browserDocument() {
|
|
29
|
+
if (typeof document === "undefined") return {};
|
|
30
|
+
return document;
|
|
31
|
+
}
|
|
32
|
+
/** Acquires one model-context binding for the lifetime of this page. */
|
|
33
|
+
function acquireModelContext(host = browserDocument()) {
|
|
34
|
+
bindingPromise ??= (async () => {
|
|
35
|
+
const acquiredGeneration = generation;
|
|
36
|
+
const native = host.modelContext;
|
|
37
|
+
if (isCompleteModelContext(native)) return {
|
|
38
|
+
kind: "native",
|
|
39
|
+
modelContext: bindNative(native)
|
|
40
|
+
};
|
|
41
|
+
const { createWebMcpSimulator } = await Promise.resolve().then(() => require("./webmcpSimulator.cjs"));
|
|
42
|
+
const created = createWebMcpSimulator();
|
|
43
|
+
if (acquiredGeneration === generation) simulator = created;
|
|
44
|
+
else created.dispose();
|
|
45
|
+
return {
|
|
46
|
+
kind: "simulator",
|
|
47
|
+
modelContext: created
|
|
48
|
+
};
|
|
49
|
+
})();
|
|
50
|
+
return bindingPromise;
|
|
51
|
+
}
|
|
52
|
+
/** Releases the fallback surface during root teardown. Native browser state remains browser-owned. */
|
|
53
|
+
function disposeModelContextAdapter() {
|
|
54
|
+
generation += 1;
|
|
55
|
+
simulator?.dispose();
|
|
56
|
+
simulator = void 0;
|
|
57
|
+
bindingPromise = void 0;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
exports.acquireModelContext = acquireModelContext;
|
|
61
|
+
exports.disposeModelContextAdapter = disposeModelContextAdapter;
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=modelContextAdapter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelContextAdapter.cjs","names":[],"sources":["../../../src/web/lib/modelContextAdapter.ts"],"sourcesContent":["import type { ModelContext, ModelContextBinding, ModelContextToolDescriptor } from '@agimon-ai/po-core/web';\n\nimport type { WebMcpSimulator } from './webmcpSimulator';\n\ninterface ModelContextDocument {\n readonly modelContext?: unknown;\n}\n\nlet bindingPromise: Promise<ModelContextBinding> | undefined;\nlet simulator: WebMcpSimulator | undefined;\nlet generation = 0;\n\nfunction hasMethod(value: object, name: keyof ModelContext): boolean {\n return typeof (value as Record<keyof ModelContext, unknown>)[name] === 'function';\n}\n\nfunction isCompleteModelContext(value: unknown): value is ModelContext {\n if (typeof value !== 'object' || value === null) return false;\n return (\n hasMethod(value, 'registerTool') &&\n hasMethod(value, 'getTools') &&\n hasMethod(value, 'executeTool') &&\n hasMethod(value, 'addEventListener') &&\n hasMethod(value, 'removeEventListener')\n );\n}\n\nfunction cloneDescriptor(descriptor: ModelContextToolDescriptor): ModelContextToolDescriptor {\n return {\n name: descriptor.name,\n description: descriptor.description,\n inputSchema: structuredClone(descriptor.inputSchema),\n };\n}\n\nfunction bindNative(modelContext: ModelContext): ModelContext {\n return {\n registerTool: modelContext.registerTool.bind(modelContext),\n getTools: async () => (await modelContext.getTools()).map(cloneDescriptor),\n executeTool: modelContext.executeTool.bind(modelContext),\n addEventListener: modelContext.addEventListener.bind(modelContext),\n removeEventListener: modelContext.removeEventListener.bind(modelContext),\n };\n}\n\nfunction browserDocument(): ModelContextDocument {\n if (typeof document === 'undefined') return {};\n return document as unknown as ModelContextDocument;\n}\n\n/** Acquires one model-context binding for the lifetime of this page. */\nexport function acquireModelContext(host: ModelContextDocument = browserDocument()): Promise<ModelContextBinding> {\n bindingPromise ??= (async () => {\n const acquiredGeneration = generation;\n const native = host.modelContext;\n if (isCompleteModelContext(native)) return { kind: 'native', modelContext: bindNative(native) };\n\n const { createWebMcpSimulator } = await import('./webmcpSimulator');\n const created = createWebMcpSimulator();\n if (acquiredGeneration === generation) simulator = created;\n else created.dispose();\n return { kind: 'simulator', modelContext: created };\n })();\n return bindingPromise;\n}\n\n/** Releases the fallback surface during root teardown. Native browser state remains browser-owned. */\nexport function disposeModelContextAdapter(): void {\n generation += 1;\n simulator?.dispose();\n simulator = undefined;\n bindingPromise = undefined;\n}\n"],"mappings":";AAQA,IAAI;AACJ,IAAI;AACJ,IAAI,aAAa;AAEjB,SAAS,UAAU,OAAe,MAAmC;CACnE,OAAO,OAAQ,MAA8C,UAAU;AACzE;AAEA,SAAS,uBAAuB,OAAuC;CACrE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,OACE,UAAU,OAAO,cAAc,KAC/B,UAAU,OAAO,UAAU,KAC3B,UAAU,OAAO,aAAa,KAC9B,UAAU,OAAO,kBAAkB,KACnC,UAAU,OAAO,qBAAqB;AAE1C;AAEA,SAAS,gBAAgB,YAAoE;CAC3F,OAAO;EACL,MAAM,WAAW;EACjB,aAAa,WAAW;EACxB,aAAa,gBAAgB,WAAW,WAAW;CACrD;AACF;AAEA,SAAS,WAAW,cAA0C;CAC5D,OAAO;EACL,cAAc,aAAa,aAAa,KAAK,YAAY;EACzD,UAAU,aAAa,MAAM,aAAa,SAAS,EAAA,CAAG,IAAI,eAAe;EACzE,aAAa,aAAa,YAAY,KAAK,YAAY;EACvD,kBAAkB,aAAa,iBAAiB,KAAK,YAAY;EACjE,qBAAqB,aAAa,oBAAoB,KAAK,YAAY;CACzE;AACF;AAEA,SAAS,kBAAwC;CAC/C,IAAI,OAAO,aAAa,aAAa,OAAO,CAAC;CAC7C,OAAO;AACT;;AAGA,SAAgB,oBAAoB,OAA6B,gBAAgB,GAAiC;CAChH,oBAAoB,YAAY;EAC9B,MAAM,qBAAqB;EAC3B,MAAM,SAAS,KAAK;EACpB,IAAI,uBAAuB,MAAM,GAAG,OAAO;GAAE,MAAM;GAAU,cAAc,WAAW,MAAM;EAAE;EAE9F,MAAM,EAAE,0BAA0B,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,uBAAA,CAAA;EACxC,MAAM,UAAU,sBAAsB;EACtC,IAAI,uBAAuB,YAAY,YAAY;OAC9C,QAAQ,QAAQ;EACrB,OAAO;GAAE,MAAM;GAAa,cAAc;EAAQ;CACpD,EAAA,CAAG;CACH,OAAO;AACT;;AAGA,SAAgB,6BAAmC;CACjD,cAAc;CACd,WAAW,QAAQ;CACnB,YAAY,KAAA;CACZ,iBAAiB,KAAA;AACnB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ModelContextBinding } from "@agimon-ai/po-core/web";
|
|
2
|
+
//#region src/web/lib/modelContextAdapter.d.ts
|
|
3
|
+
interface ModelContextDocument {
|
|
4
|
+
readonly modelContext?: unknown;
|
|
5
|
+
}
|
|
6
|
+
/** Acquires one model-context binding for the lifetime of this page. */
|
|
7
|
+
export declare function acquireModelContext(host?: ModelContextDocument): Promise<ModelContextBinding>;
|
|
8
|
+
/** Releases the fallback surface during root teardown. Native browser state remains browser-owned. */
|
|
9
|
+
export declare function disposeModelContextAdapter(): void;
|
|
10
|
+
//#endregion
|
|
11
|
+
//# sourceMappingURL=modelContextAdapter.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelContextAdapter.d.mts","names":[],"sources":["../../../src/web/lib/modelContextAdapter.ts"],"mappings":";;UAIU;WACC;;;wBA8CK,oBAAoB,OAAM,uBAA2C,QAAQ;;wBAgB7E"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//#region src/web/lib/modelContextAdapter.ts
|
|
2
|
+
let bindingPromise;
|
|
3
|
+
let simulator;
|
|
4
|
+
let generation = 0;
|
|
5
|
+
function hasMethod(value, name) {
|
|
6
|
+
return typeof value[name] === "function";
|
|
7
|
+
}
|
|
8
|
+
function isCompleteModelContext(value) {
|
|
9
|
+
if (typeof value !== "object" || value === null) return false;
|
|
10
|
+
return hasMethod(value, "registerTool") && hasMethod(value, "getTools") && hasMethod(value, "executeTool") && hasMethod(value, "addEventListener") && hasMethod(value, "removeEventListener");
|
|
11
|
+
}
|
|
12
|
+
function cloneDescriptor(descriptor) {
|
|
13
|
+
return {
|
|
14
|
+
name: descriptor.name,
|
|
15
|
+
description: descriptor.description,
|
|
16
|
+
inputSchema: structuredClone(descriptor.inputSchema)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function bindNative(modelContext) {
|
|
20
|
+
return {
|
|
21
|
+
registerTool: modelContext.registerTool.bind(modelContext),
|
|
22
|
+
getTools: async () => (await modelContext.getTools()).map(cloneDescriptor),
|
|
23
|
+
executeTool: modelContext.executeTool.bind(modelContext),
|
|
24
|
+
addEventListener: modelContext.addEventListener.bind(modelContext),
|
|
25
|
+
removeEventListener: modelContext.removeEventListener.bind(modelContext)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function browserDocument() {
|
|
29
|
+
if (typeof document === "undefined") return {};
|
|
30
|
+
return document;
|
|
31
|
+
}
|
|
32
|
+
/** Acquires one model-context binding for the lifetime of this page. */
|
|
33
|
+
function acquireModelContext(host = browserDocument()) {
|
|
34
|
+
bindingPromise ??= (async () => {
|
|
35
|
+
const acquiredGeneration = generation;
|
|
36
|
+
const native = host.modelContext;
|
|
37
|
+
if (isCompleteModelContext(native)) return {
|
|
38
|
+
kind: "native",
|
|
39
|
+
modelContext: bindNative(native)
|
|
40
|
+
};
|
|
41
|
+
const { createWebMcpSimulator } = await import("./webmcpSimulator.mjs");
|
|
42
|
+
const created = createWebMcpSimulator();
|
|
43
|
+
if (acquiredGeneration === generation) simulator = created;
|
|
44
|
+
else created.dispose();
|
|
45
|
+
return {
|
|
46
|
+
kind: "simulator",
|
|
47
|
+
modelContext: created
|
|
48
|
+
};
|
|
49
|
+
})();
|
|
50
|
+
return bindingPromise;
|
|
51
|
+
}
|
|
52
|
+
/** Releases the fallback surface during root teardown. Native browser state remains browser-owned. */
|
|
53
|
+
function disposeModelContextAdapter() {
|
|
54
|
+
generation += 1;
|
|
55
|
+
simulator?.dispose();
|
|
56
|
+
simulator = void 0;
|
|
57
|
+
bindingPromise = void 0;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { acquireModelContext, disposeModelContextAdapter };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=modelContextAdapter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelContextAdapter.mjs","names":[],"sources":["../../../src/web/lib/modelContextAdapter.ts"],"sourcesContent":["import type { ModelContext, ModelContextBinding, ModelContextToolDescriptor } from '@agimon-ai/po-core/web';\n\nimport type { WebMcpSimulator } from './webmcpSimulator';\n\ninterface ModelContextDocument {\n readonly modelContext?: unknown;\n}\n\nlet bindingPromise: Promise<ModelContextBinding> | undefined;\nlet simulator: WebMcpSimulator | undefined;\nlet generation = 0;\n\nfunction hasMethod(value: object, name: keyof ModelContext): boolean {\n return typeof (value as Record<keyof ModelContext, unknown>)[name] === 'function';\n}\n\nfunction isCompleteModelContext(value: unknown): value is ModelContext {\n if (typeof value !== 'object' || value === null) return false;\n return (\n hasMethod(value, 'registerTool') &&\n hasMethod(value, 'getTools') &&\n hasMethod(value, 'executeTool') &&\n hasMethod(value, 'addEventListener') &&\n hasMethod(value, 'removeEventListener')\n );\n}\n\nfunction cloneDescriptor(descriptor: ModelContextToolDescriptor): ModelContextToolDescriptor {\n return {\n name: descriptor.name,\n description: descriptor.description,\n inputSchema: structuredClone(descriptor.inputSchema),\n };\n}\n\nfunction bindNative(modelContext: ModelContext): ModelContext {\n return {\n registerTool: modelContext.registerTool.bind(modelContext),\n getTools: async () => (await modelContext.getTools()).map(cloneDescriptor),\n executeTool: modelContext.executeTool.bind(modelContext),\n addEventListener: modelContext.addEventListener.bind(modelContext),\n removeEventListener: modelContext.removeEventListener.bind(modelContext),\n };\n}\n\nfunction browserDocument(): ModelContextDocument {\n if (typeof document === 'undefined') return {};\n return document as unknown as ModelContextDocument;\n}\n\n/** Acquires one model-context binding for the lifetime of this page. */\nexport function acquireModelContext(host: ModelContextDocument = browserDocument()): Promise<ModelContextBinding> {\n bindingPromise ??= (async () => {\n const acquiredGeneration = generation;\n const native = host.modelContext;\n if (isCompleteModelContext(native)) return { kind: 'native', modelContext: bindNative(native) };\n\n const { createWebMcpSimulator } = await import('./webmcpSimulator');\n const created = createWebMcpSimulator();\n if (acquiredGeneration === generation) simulator = created;\n else created.dispose();\n return { kind: 'simulator', modelContext: created };\n })();\n return bindingPromise;\n}\n\n/** Releases the fallback surface during root teardown. Native browser state remains browser-owned. */\nexport function disposeModelContextAdapter(): void {\n generation += 1;\n simulator?.dispose();\n simulator = undefined;\n bindingPromise = undefined;\n}\n"],"mappings":";AAQA,IAAI;AACJ,IAAI;AACJ,IAAI,aAAa;AAEjB,SAAS,UAAU,OAAe,MAAmC;CACnE,OAAO,OAAQ,MAA8C,UAAU;AACzE;AAEA,SAAS,uBAAuB,OAAuC;CACrE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,OACE,UAAU,OAAO,cAAc,KAC/B,UAAU,OAAO,UAAU,KAC3B,UAAU,OAAO,aAAa,KAC9B,UAAU,OAAO,kBAAkB,KACnC,UAAU,OAAO,qBAAqB;AAE1C;AAEA,SAAS,gBAAgB,YAAoE;CAC3F,OAAO;EACL,MAAM,WAAW;EACjB,aAAa,WAAW;EACxB,aAAa,gBAAgB,WAAW,WAAW;CACrD;AACF;AAEA,SAAS,WAAW,cAA0C;CAC5D,OAAO;EACL,cAAc,aAAa,aAAa,KAAK,YAAY;EACzD,UAAU,aAAa,MAAM,aAAa,SAAS,EAAA,CAAG,IAAI,eAAe;EACzE,aAAa,aAAa,YAAY,KAAK,YAAY;EACvD,kBAAkB,aAAa,iBAAiB,KAAK,YAAY;EACjE,qBAAqB,aAAa,oBAAoB,KAAK,YAAY;CACzE;AACF;AAEA,SAAS,kBAAwC;CAC/C,IAAI,OAAO,aAAa,aAAa,OAAO,CAAC;CAC7C,OAAO;AACT;;AAGA,SAAgB,oBAAoB,OAA6B,gBAAgB,GAAiC;CAChH,oBAAoB,YAAY;EAC9B,MAAM,qBAAqB;EAC3B,MAAM,SAAS,KAAK;EACpB,IAAI,uBAAuB,MAAM,GAAG,OAAO;GAAE,MAAM;GAAU,cAAc,WAAW,MAAM;EAAE;EAE9F,MAAM,EAAE,0BAA0B,MAAM,OAAO;EAC/C,MAAM,UAAU,sBAAsB;EACtC,IAAI,uBAAuB,YAAY,YAAY;OAC9C,QAAQ,QAAQ;EACrB,OAAO;GAAE,MAAM;GAAa,cAAc;EAAQ;CACpD,EAAA,CAAG;CACH,OAAO;AACT;;AAGA,SAAgB,6BAAmC;CACjD,cAAc;CACd,WAAW,QAAQ;CACnB,YAAY,KAAA;CACZ,iBAAiB,KAAA;AACnB"}
|