@elizaos/app-core 2.0.0-alpha.37
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/.turbo/turbo-build.log +2 -0
- package/LICENSE +21 -0
- package/dist/App.d.ts +5 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +198 -0
- package/dist/actions/character.d.ts +27 -0
- package/dist/actions/character.d.ts.map +1 -0
- package/dist/actions/character.js +97 -0
- package/dist/actions/chat-helpers.d.ts +47 -0
- package/dist/actions/chat-helpers.d.ts.map +1 -0
- package/dist/actions/chat-helpers.js +79 -0
- package/dist/actions/cloud.d.ts +17 -0
- package/dist/actions/cloud.d.ts.map +1 -0
- package/dist/actions/cloud.js +43 -0
- package/dist/actions/index.d.ts +12 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +11 -0
- package/dist/actions/lifecycle.d.ts +43 -0
- package/dist/actions/lifecycle.d.ts.map +1 -0
- package/dist/actions/lifecycle.js +118 -0
- package/dist/actions/onboarding.d.ts +12 -0
- package/dist/actions/onboarding.d.ts.map +1 -0
- package/dist/actions/onboarding.js +28 -0
- package/dist/actions/triggers.d.ts +23 -0
- package/dist/actions/triggers.d.ts.map +1 -0
- package/dist/actions/triggers.js +148 -0
- package/dist/api/client.d.ts +2823 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +2392 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +1 -0
- package/dist/autonomy/index.d.ts +48 -0
- package/dist/autonomy/index.d.ts.map +1 -0
- package/dist/autonomy/index.js +330 -0
- package/dist/bridge/capacitor-bridge.d.ts +153 -0
- package/dist/bridge/capacitor-bridge.d.ts.map +1 -0
- package/dist/bridge/capacitor-bridge.js +193 -0
- package/dist/bridge/electrobun-rpc.d.ts +19 -0
- package/dist/bridge/electrobun-rpc.d.ts.map +1 -0
- package/dist/bridge/electrobun-rpc.js +27 -0
- package/dist/bridge/electrobun-runtime.d.ts +3 -0
- package/dist/bridge/electrobun-runtime.d.ts.map +1 -0
- package/dist/bridge/electrobun-runtime.js +17 -0
- package/dist/bridge/index.d.ts +6 -0
- package/dist/bridge/index.d.ts.map +1 -0
- package/dist/bridge/index.js +5 -0
- package/dist/bridge/native-plugins.d.ts +82 -0
- package/dist/bridge/native-plugins.d.ts.map +1 -0
- package/dist/bridge/native-plugins.js +39 -0
- package/dist/bridge/plugin-bridge.d.ts +116 -0
- package/dist/bridge/plugin-bridge.d.ts.map +1 -0
- package/dist/bridge/plugin-bridge.js +203 -0
- package/dist/bridge/storage-bridge.d.ts +39 -0
- package/dist/bridge/storage-bridge.d.ts.map +1 -0
- package/dist/bridge/storage-bridge.js +135 -0
- package/dist/chat/index.d.ts +57 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/index.js +161 -0
- package/dist/coding/index.d.ts +25 -0
- package/dist/coding/index.d.ts.map +1 -0
- package/dist/coding/index.js +25 -0
- package/dist/components/AdvancedPageView.d.ts +17 -0
- package/dist/components/AdvancedPageView.d.ts.map +1 -0
- package/dist/components/AdvancedPageView.js +137 -0
- package/dist/components/AgentActivityBox.d.ts +7 -0
- package/dist/components/AgentActivityBox.d.ts.map +1 -0
- package/dist/components/AgentActivityBox.js +25 -0
- package/dist/components/ApiKeyConfig.d.ts +26 -0
- package/dist/components/ApiKeyConfig.d.ts.map +1 -0
- package/dist/components/ApiKeyConfig.js +121 -0
- package/dist/components/AppsPageView.d.ts +7 -0
- package/dist/components/AppsPageView.d.ts.map +1 -0
- package/dist/components/AppsPageView.js +31 -0
- package/dist/components/AppsView.d.ts +8 -0
- package/dist/components/AppsView.d.ts.map +1 -0
- package/dist/components/AppsView.js +149 -0
- package/dist/components/AvatarLoader.d.ts +9 -0
- package/dist/components/AvatarLoader.d.ts.map +1 -0
- package/dist/components/AvatarLoader.js +45 -0
- package/dist/components/AvatarSelector.d.ts +23 -0
- package/dist/components/AvatarSelector.d.ts.map +1 -0
- package/dist/components/AvatarSelector.js +105 -0
- package/dist/components/BscTradePanel.d.ts +22 -0
- package/dist/components/BscTradePanel.d.ts.map +1 -0
- package/dist/components/BscTradePanel.js +221 -0
- package/dist/components/BugReportModal.d.ts +2 -0
- package/dist/components/BugReportModal.d.ts.map +1 -0
- package/dist/components/BugReportModal.js +218 -0
- package/dist/components/CharacterView.d.ts +8 -0
- package/dist/components/CharacterView.d.ts.map +1 -0
- package/dist/components/CharacterView.js +703 -0
- package/dist/components/ChatAvatar.d.ts +8 -0
- package/dist/components/ChatAvatar.d.ts.map +1 -0
- package/dist/components/ChatAvatar.js +89 -0
- package/dist/components/ChatComposer.d.ts +37 -0
- package/dist/components/ChatComposer.d.ts.map +1 -0
- package/dist/components/ChatComposer.js +136 -0
- package/dist/components/ChatMessage.d.ts +24 -0
- package/dist/components/ChatMessage.d.ts.map +1 -0
- package/dist/components/ChatMessage.js +167 -0
- package/dist/components/ChatModalView.d.ts +10 -0
- package/dist/components/ChatModalView.d.ts.map +1 -0
- package/dist/components/ChatModalView.js +57 -0
- package/dist/components/ChatView.d.ts +14 -0
- package/dist/components/ChatView.d.ts.map +1 -0
- package/dist/components/ChatView.js +511 -0
- package/dist/components/CloudSourceControls.d.ts +13 -0
- package/dist/components/CloudSourceControls.d.ts.map +1 -0
- package/dist/components/CloudSourceControls.js +14 -0
- package/dist/components/CodingAgentSettingsSection.d.ts +2 -0
- package/dist/components/CodingAgentSettingsSection.d.ts.map +1 -0
- package/dist/components/CodingAgentSettingsSection.js +268 -0
- package/dist/components/CommandPalette.d.ts +2 -0
- package/dist/components/CommandPalette.d.ts.map +1 -0
- package/dist/components/CommandPalette.js +181 -0
- package/dist/components/CompanionSceneHost.d.ts +15 -0
- package/dist/components/CompanionSceneHost.d.ts.map +1 -0
- package/dist/components/CompanionSceneHost.js +343 -0
- package/dist/components/CompanionShell.d.ts +17 -0
- package/dist/components/CompanionShell.d.ts.map +1 -0
- package/dist/components/CompanionShell.js +15 -0
- package/dist/components/CompanionView.d.ts +2 -0
- package/dist/components/CompanionView.d.ts.map +1 -0
- package/dist/components/CompanionView.js +22 -0
- package/dist/components/ConfigPageView.d.ts +11 -0
- package/dist/components/ConfigPageView.d.ts.map +1 -0
- package/dist/components/ConfigPageView.js +275 -0
- package/dist/components/ConfigSaveFooter.d.ts +8 -0
- package/dist/components/ConfigSaveFooter.d.ts.map +1 -0
- package/dist/components/ConfigSaveFooter.js +10 -0
- package/dist/components/ConfirmModal.d.ts +61 -0
- package/dist/components/ConfirmModal.d.ts.map +1 -0
- package/dist/components/ConfirmModal.js +164 -0
- package/dist/components/ConnectionFailedBanner.d.ts +6 -0
- package/dist/components/ConnectionFailedBanner.d.ts.map +1 -0
- package/dist/components/ConnectionFailedBanner.js +22 -0
- package/dist/components/ConnectorsPageView.d.ts +7 -0
- package/dist/components/ConnectorsPageView.d.ts.map +1 -0
- package/dist/components/ConnectorsPageView.js +8 -0
- package/dist/components/ConversationsSidebar.d.ts +9 -0
- package/dist/components/ConversationsSidebar.d.ts.map +1 -0
- package/dist/components/ConversationsSidebar.js +116 -0
- package/dist/components/CustomActionEditor.d.ts +10 -0
- package/dist/components/CustomActionEditor.d.ts.map +1 -0
- package/dist/components/CustomActionEditor.js +578 -0
- package/dist/components/CustomActionsPanel.d.ts +9 -0
- package/dist/components/CustomActionsPanel.d.ts.map +1 -0
- package/dist/components/CustomActionsPanel.js +107 -0
- package/dist/components/CustomActionsView.d.ts +2 -0
- package/dist/components/CustomActionsView.d.ts.map +1 -0
- package/dist/components/CustomActionsView.js +134 -0
- package/dist/components/DatabasePageView.d.ts +5 -0
- package/dist/components/DatabasePageView.d.ts.map +1 -0
- package/dist/components/DatabasePageView.js +28 -0
- package/dist/components/DatabaseView.d.ts +9 -0
- package/dist/components/DatabaseView.d.ts.map +1 -0
- package/dist/components/DatabaseView.js +311 -0
- package/dist/components/ElizaCloudDashboard.d.ts +2 -0
- package/dist/components/ElizaCloudDashboard.d.ts.map +1 -0
- package/dist/components/ElizaCloudDashboard.js +657 -0
- package/dist/components/EmotePicker.d.ts +2 -0
- package/dist/components/EmotePicker.d.ts.map +1 -0
- package/dist/components/EmotePicker.js +343 -0
- package/dist/components/ErrorBoundary.d.ts +22 -0
- package/dist/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/ErrorBoundary.js +31 -0
- package/dist/components/FineTuningView.d.ts +2 -0
- package/dist/components/FineTuningView.d.ts.map +1 -0
- package/dist/components/FineTuningView.js +433 -0
- package/dist/components/GameView.d.ts +11 -0
- package/dist/components/GameView.d.ts.map +1 -0
- package/dist/components/GameView.js +295 -0
- package/dist/components/GameViewOverlay.d.ts +8 -0
- package/dist/components/GameViewOverlay.d.ts.map +1 -0
- package/dist/components/GameViewOverlay.js +70 -0
- package/dist/components/GlobalEmoteOverlay.d.ts +2 -0
- package/dist/components/GlobalEmoteOverlay.d.ts.map +1 -0
- package/dist/components/GlobalEmoteOverlay.js +112 -0
- package/dist/components/Header.d.ts +8 -0
- package/dist/components/Header.d.ts.map +1 -0
- package/dist/components/Header.js +121 -0
- package/dist/components/HeartbeatsView.d.ts +2 -0
- package/dist/components/HeartbeatsView.d.ts.map +1 -0
- package/dist/components/HeartbeatsView.js +378 -0
- package/dist/components/InventoryView.d.ts +10 -0
- package/dist/components/InventoryView.d.ts.map +1 -0
- package/dist/components/InventoryView.js +162 -0
- package/dist/components/KnowledgeView.d.ts +20 -0
- package/dist/components/KnowledgeView.d.ts.map +1 -0
- package/dist/components/KnowledgeView.js +480 -0
- package/dist/components/LanguageDropdown.d.ts +30 -0
- package/dist/components/LanguageDropdown.d.ts.map +1 -0
- package/dist/components/LanguageDropdown.js +98 -0
- package/dist/components/LifoMonitorPanel.d.ts +21 -0
- package/dist/components/LifoMonitorPanel.d.ts.map +1 -0
- package/dist/components/LifoMonitorPanel.js +24 -0
- package/dist/components/LifoSandboxView.d.ts +5 -0
- package/dist/components/LifoSandboxView.d.ts.map +1 -0
- package/dist/components/LifoSandboxView.js +333 -0
- package/dist/components/LoadingScreen.d.ts +13 -0
- package/dist/components/LoadingScreen.d.ts.map +1 -0
- package/dist/components/LoadingScreen.js +39 -0
- package/dist/components/LogsPageView.d.ts +2 -0
- package/dist/components/LogsPageView.d.ts.map +1 -0
- package/dist/components/LogsPageView.js +7 -0
- package/dist/components/LogsView.d.ts +5 -0
- package/dist/components/LogsView.d.ts.map +1 -0
- package/dist/components/LogsView.js +71 -0
- package/dist/components/MediaGalleryView.d.ts +9 -0
- package/dist/components/MediaGalleryView.d.ts.map +1 -0
- package/dist/components/MediaGalleryView.js +236 -0
- package/dist/components/MediaSettingsSection.d.ts +11 -0
- package/dist/components/MediaSettingsSection.d.ts.map +1 -0
- package/dist/components/MediaSettingsSection.js +329 -0
- package/dist/components/MessageContent.d.ts +51 -0
- package/dist/components/MessageContent.d.ts.map +1 -0
- package/dist/components/MessageContent.js +553 -0
- package/dist/components/OnboardingWizard.d.ts +2 -0
- package/dist/components/OnboardingWizard.d.ts.map +1 -0
- package/dist/components/OnboardingWizard.js +59 -0
- package/dist/components/PairingView.d.ts +5 -0
- package/dist/components/PairingView.d.ts.map +1 -0
- package/dist/components/PairingView.js +28 -0
- package/dist/components/PermissionsSection.d.ts +20 -0
- package/dist/components/PermissionsSection.d.ts.map +1 -0
- package/dist/components/PermissionsSection.js +368 -0
- package/dist/components/PluginsPageView.d.ts +5 -0
- package/dist/components/PluginsPageView.d.ts.map +1 -0
- package/dist/components/PluginsPageView.js +8 -0
- package/dist/components/PluginsView.d.ts +21 -0
- package/dist/components/PluginsView.d.ts.map +1 -0
- package/dist/components/PluginsView.js +1531 -0
- package/dist/components/ProviderSwitcher.d.ts +42 -0
- package/dist/components/ProviderSwitcher.d.ts.map +1 -0
- package/dist/components/ProviderSwitcher.js +480 -0
- package/dist/components/RestartBanner.d.ts +2 -0
- package/dist/components/RestartBanner.d.ts.map +1 -0
- package/dist/components/RestartBanner.js +36 -0
- package/dist/components/RuntimeView.d.ts +10 -0
- package/dist/components/RuntimeView.d.ts.map +1 -0
- package/dist/components/RuntimeView.js +165 -0
- package/dist/components/SaveCommandModal.d.ts +12 -0
- package/dist/components/SaveCommandModal.d.ts.map +1 -0
- package/dist/components/SaveCommandModal.js +84 -0
- package/dist/components/SecretsView.d.ts +9 -0
- package/dist/components/SecretsView.d.ts.map +1 -0
- package/dist/components/SecretsView.js +249 -0
- package/dist/components/SettingsView.d.ts +9 -0
- package/dist/components/SettingsView.d.ts.map +1 -0
- package/dist/components/SettingsView.js +230 -0
- package/dist/components/ShellOverlays.d.ts +8 -0
- package/dist/components/ShellOverlays.d.ts.map +1 -0
- package/dist/components/ShellOverlays.js +10 -0
- package/dist/components/ShortcutsOverlay.d.ts +2 -0
- package/dist/components/ShortcutsOverlay.d.ts.map +1 -0
- package/dist/components/ShortcutsOverlay.js +79 -0
- package/dist/components/SkillsView.d.ts +11 -0
- package/dist/components/SkillsView.d.ts.map +1 -0
- package/dist/components/SkillsView.js +358 -0
- package/dist/components/StartupFailureView.d.ts +8 -0
- package/dist/components/StartupFailureView.d.ts.map +1 -0
- package/dist/components/StartupFailureView.js +15 -0
- package/dist/components/StreamView.d.ts +16 -0
- package/dist/components/StreamView.d.ts.map +1 -0
- package/dist/components/StreamView.js +300 -0
- package/dist/components/StripeEmbeddedCheckout.d.ts +24 -0
- package/dist/components/StripeEmbeddedCheckout.d.ts.map +1 -0
- package/dist/components/StripeEmbeddedCheckout.js +101 -0
- package/dist/components/SubscriptionStatus.d.ts +22 -0
- package/dist/components/SubscriptionStatus.d.ts.map +1 -0
- package/dist/components/SubscriptionStatus.js +301 -0
- package/dist/components/SystemWarningBanner.d.ts +6 -0
- package/dist/components/SystemWarningBanner.d.ts.map +1 -0
- package/dist/components/SystemWarningBanner.js +46 -0
- package/dist/components/ThemeToggle.d.ts +21 -0
- package/dist/components/ThemeToggle.d.ts.map +1 -0
- package/dist/components/ThemeToggle.js +24 -0
- package/dist/components/TrajectoriesView.d.ts +12 -0
- package/dist/components/TrajectoriesView.d.ts.map +1 -0
- package/dist/components/TrajectoriesView.js +183 -0
- package/dist/components/TrajectoryDetailView.d.ts +13 -0
- package/dist/components/TrajectoryDetailView.d.ts.map +1 -0
- package/dist/components/TrajectoryDetailView.js +112 -0
- package/dist/components/TriggersView.d.ts +2 -0
- package/dist/components/TriggersView.d.ts.map +1 -0
- package/dist/components/TriggersView.js +1 -0
- package/dist/components/VectorBrowserView.d.ts +10 -0
- package/dist/components/VectorBrowserView.d.ts.map +1 -0
- package/dist/components/VectorBrowserView.js +997 -0
- package/dist/components/VoiceConfigView.d.ts +11 -0
- package/dist/components/VoiceConfigView.d.ts.map +1 -0
- package/dist/components/VoiceConfigView.js +329 -0
- package/dist/components/VrmStage.d.ts +21 -0
- package/dist/components/VrmStage.d.ts.map +1 -0
- package/dist/components/VrmStage.js +252 -0
- package/dist/components/WhatsAppQrOverlay.d.ts +8 -0
- package/dist/components/WhatsAppQrOverlay.d.ts.map +1 -0
- package/dist/components/WhatsAppQrOverlay.js +63 -0
- package/dist/components/apps/AppDetailPane.d.ts +15 -0
- package/dist/components/apps/AppDetailPane.d.ts.map +1 -0
- package/dist/components/apps/AppDetailPane.js +13 -0
- package/dist/components/apps/AppsCatalogGrid.d.ts +20 -0
- package/dist/components/apps/AppsCatalogGrid.d.ts.map +1 -0
- package/dist/components/apps/AppsCatalogGrid.js +18 -0
- package/dist/components/apps/extensions/HyperscapeAppDetailPanel.d.ts +3 -0
- package/dist/components/apps/extensions/HyperscapeAppDetailPanel.d.ts.map +1 -0
- package/dist/components/apps/extensions/HyperscapeAppDetailPanel.js +253 -0
- package/dist/components/apps/extensions/registry.d.ts +4 -0
- package/dist/components/apps/extensions/registry.d.ts.map +1 -0
- package/dist/components/apps/extensions/registry.js +10 -0
- package/dist/components/apps/extensions/types.d.ts +7 -0
- package/dist/components/apps/extensions/types.d.ts.map +1 -0
- package/dist/components/apps/extensions/types.js +1 -0
- package/dist/components/apps/helpers.d.ts +7 -0
- package/dist/components/apps/helpers.d.ts.map +1 -0
- package/dist/components/apps/helpers.js +46 -0
- package/dist/components/avatar/VrmAnimationLoader.d.ts +30 -0
- package/dist/components/avatar/VrmAnimationLoader.d.ts.map +1 -0
- package/dist/components/avatar/VrmAnimationLoader.js +99 -0
- package/dist/components/avatar/VrmBlinkController.d.ts +37 -0
- package/dist/components/avatar/VrmBlinkController.d.ts.map +1 -0
- package/dist/components/avatar/VrmBlinkController.js +98 -0
- package/dist/components/avatar/VrmCameraManager.d.ts +57 -0
- package/dist/components/avatar/VrmCameraManager.d.ts.map +1 -0
- package/dist/components/avatar/VrmCameraManager.js +277 -0
- package/dist/components/avatar/VrmEngine.d.ts +229 -0
- package/dist/components/avatar/VrmEngine.d.ts.map +1 -0
- package/dist/components/avatar/VrmEngine.js +1950 -0
- package/dist/components/avatar/VrmFootShadow.d.ts +18 -0
- package/dist/components/avatar/VrmFootShadow.d.ts.map +1 -0
- package/dist/components/avatar/VrmFootShadow.js +83 -0
- package/dist/components/avatar/VrmViewer.d.ts +45 -0
- package/dist/components/avatar/VrmViewer.d.ts.map +1 -0
- package/dist/components/avatar/VrmViewer.js +341 -0
- package/dist/components/avatar/mixamoVRMRigMap.d.ts +3 -0
- package/dist/components/avatar/mixamoVRMRigMap.d.ts.map +1 -0
- package/dist/components/avatar/mixamoVRMRigMap.js +56 -0
- package/dist/components/avatar/retargetMixamoFbxToVrm.d.ts +9 -0
- package/dist/components/avatar/retargetMixamoFbxToVrm.d.ts.map +1 -0
- package/dist/components/avatar/retargetMixamoFbxToVrm.js +88 -0
- package/dist/components/avatar/retargetMixamoGltfToVrm.d.ts +11 -0
- package/dist/components/avatar/retargetMixamoGltfToVrm.d.ts.map +1 -0
- package/dist/components/avatar/retargetMixamoGltfToVrm.js +80 -0
- package/dist/components/chainConfig.d.ts +84 -0
- package/dist/components/chainConfig.d.ts.map +1 -0
- package/dist/components/chainConfig.js +268 -0
- package/dist/components/companion/CompanionHeader.d.ts +15 -0
- package/dist/components/companion/CompanionHeader.d.ts.map +1 -0
- package/dist/components/companion/CompanionHeader.js +7 -0
- package/dist/components/companion/CompanionSceneHost.d.ts +2 -0
- package/dist/components/companion/CompanionSceneHost.d.ts.map +1 -0
- package/dist/components/companion/CompanionSceneHost.js +1 -0
- package/dist/components/companion/VrmStage.d.ts +3 -0
- package/dist/components/companion/VrmStage.d.ts.map +1 -0
- package/dist/components/companion/VrmStage.js +1 -0
- package/dist/components/companion/walletUtils.d.ts +95 -0
- package/dist/components/companion/walletUtils.d.ts.map +1 -0
- package/dist/components/companion/walletUtils.js +167 -0
- package/dist/components/companion-shell-styles.d.ts +38 -0
- package/dist/components/companion-shell-styles.d.ts.map +1 -0
- package/dist/components/companion-shell-styles.js +248 -0
- package/dist/components/confirm-delete-control.d.ts +16 -0
- package/dist/components/confirm-delete-control.d.ts.map +1 -0
- package/dist/components/confirm-delete-control.js +12 -0
- package/dist/components/conversations/ConversationListItem.d.ts +31 -0
- package/dist/components/conversations/ConversationListItem.d.ts.map +1 -0
- package/dist/components/conversations/ConversationListItem.js +52 -0
- package/dist/components/conversations/conversation-utils.d.ts +9 -0
- package/dist/components/conversations/conversation-utils.d.ts.map +1 -0
- package/dist/components/conversations/conversation-utils.js +138 -0
- package/dist/components/format.d.ts +54 -0
- package/dist/components/format.d.ts.map +1 -0
- package/dist/components/format.js +82 -0
- package/dist/components/index.d.ts +93 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +92 -0
- package/dist/components/inventory/CopyableAddress.d.ts +8 -0
- package/dist/components/inventory/CopyableAddress.d.ts.map +1 -0
- package/dist/components/inventory/CopyableAddress.js +18 -0
- package/dist/components/inventory/InventoryToolbar.d.ts +25 -0
- package/dist/components/inventory/InventoryToolbar.d.ts.map +1 -0
- package/dist/components/inventory/InventoryToolbar.js +28 -0
- package/dist/components/inventory/NftGrid.d.ts +13 -0
- package/dist/components/inventory/NftGrid.d.ts.map +1 -0
- package/dist/components/inventory/NftGrid.js +29 -0
- package/dist/components/inventory/TokenLogo.d.ts +12 -0
- package/dist/components/inventory/TokenLogo.d.ts.map +1 -0
- package/dist/components/inventory/TokenLogo.js +33 -0
- package/dist/components/inventory/TokensTable.d.ts +24 -0
- package/dist/components/inventory/TokensTable.d.ts.map +1 -0
- package/dist/components/inventory/TokensTable.js +26 -0
- package/dist/components/inventory/constants.d.ts +52 -0
- package/dist/components/inventory/constants.d.ts.map +1 -0
- package/dist/components/inventory/constants.js +121 -0
- package/dist/components/inventory/index.d.ts +9 -0
- package/dist/components/inventory/index.d.ts.map +1 -0
- package/dist/components/inventory/index.js +8 -0
- package/dist/components/inventory/media-url.d.ts +6 -0
- package/dist/components/inventory/media-url.d.ts.map +1 -0
- package/dist/components/inventory/media-url.js +28 -0
- package/dist/components/inventory/useInventoryData.d.ts +53 -0
- package/dist/components/inventory/useInventoryData.d.ts.map +1 -0
- package/dist/components/inventory/useInventoryData.js +332 -0
- package/dist/components/knowledge-upload-image.d.ts +27 -0
- package/dist/components/knowledge-upload-image.d.ts.map +1 -0
- package/dist/components/knowledge-upload-image.js +146 -0
- package/dist/components/labels.d.ts +6 -0
- package/dist/components/labels.d.ts.map +1 -0
- package/dist/components/labels.js +40 -0
- package/dist/components/onboarding/ActivateStep.d.ts +2 -0
- package/dist/components/onboarding/ActivateStep.d.ts.map +1 -0
- package/dist/components/onboarding/ActivateStep.js +6 -0
- package/dist/components/onboarding/ConnectionStep.d.ts +2 -0
- package/dist/components/onboarding/ConnectionStep.d.ts.map +1 -0
- package/dist/components/onboarding/ConnectionStep.js +552 -0
- package/dist/components/onboarding/OnboardingPanel.d.ts +9 -0
- package/dist/components/onboarding/OnboardingPanel.d.ts.map +1 -0
- package/dist/components/onboarding/OnboardingPanel.js +24 -0
- package/dist/components/onboarding/OnboardingStepNav.d.ts +2 -0
- package/dist/components/onboarding/OnboardingStepNav.d.ts.map +1 -0
- package/dist/components/onboarding/OnboardingStepNav.js +14 -0
- package/dist/components/onboarding/PermissionsStep.d.ts +2 -0
- package/dist/components/onboarding/PermissionsStep.d.ts.map +1 -0
- package/dist/components/onboarding/PermissionsStep.js +7 -0
- package/dist/components/onboarding/RpcStep.d.ts +2 -0
- package/dist/components/onboarding/RpcStep.d.ts.map +1 -0
- package/dist/components/onboarding/RpcStep.js +125 -0
- package/dist/components/onboarding/WakeUpStep.d.ts +2 -0
- package/dist/components/onboarding/WakeUpStep.d.ts.map +1 -0
- package/dist/components/onboarding/WakeUpStep.js +82 -0
- package/dist/components/permissions/PermissionIcon.d.ts +4 -0
- package/dist/components/permissions/PermissionIcon.d.ts.map +1 -0
- package/dist/components/permissions/PermissionIcon.js +12 -0
- package/dist/components/permissions/StreamingPermissions.d.ts +20 -0
- package/dist/components/permissions/StreamingPermissions.d.ts.map +1 -0
- package/dist/components/permissions/StreamingPermissions.js +173 -0
- package/dist/components/plugins/showcase-data.d.ts +7 -0
- package/dist/components/plugins/showcase-data.d.ts.map +1 -0
- package/dist/components/plugins/showcase-data.js +464 -0
- package/dist/components/shared/ShellHeaderControls.d.ts +27 -0
- package/dist/components/shared/ShellHeaderControls.d.ts.map +1 -0
- package/dist/components/shared/ShellHeaderControls.js +60 -0
- package/dist/components/skeletons.d.ts +17 -0
- package/dist/components/skeletons.d.ts.map +1 -0
- package/dist/components/skeletons.js +22 -0
- package/dist/components/stream/ActivityFeed.d.ts +5 -0
- package/dist/components/stream/ActivityFeed.d.ts.map +1 -0
- package/dist/components/stream/ActivityFeed.js +57 -0
- package/dist/components/stream/AvatarPip.d.ts +5 -0
- package/dist/components/stream/AvatarPip.d.ts.map +1 -0
- package/dist/components/stream/AvatarPip.js +6 -0
- package/dist/components/stream/ChatContent.d.ts +6 -0
- package/dist/components/stream/ChatContent.d.ts.map +1 -0
- package/dist/components/stream/ChatContent.js +69 -0
- package/dist/components/stream/ChatTicker.d.ts +5 -0
- package/dist/components/stream/ChatTicker.d.ts.map +1 -0
- package/dist/components/stream/ChatTicker.js +34 -0
- package/dist/components/stream/IdleContent.d.ts +5 -0
- package/dist/components/stream/IdleContent.d.ts.map +1 -0
- package/dist/components/stream/IdleContent.js +17 -0
- package/dist/components/stream/StatusBar.d.ts +36 -0
- package/dist/components/stream/StatusBar.d.ts.map +1 -0
- package/dist/components/stream/StatusBar.js +140 -0
- package/dist/components/stream/StreamSettings.d.ts +33 -0
- package/dist/components/stream/StreamSettings.d.ts.map +1 -0
- package/dist/components/stream/StreamSettings.js +99 -0
- package/dist/components/stream/StreamTerminal.d.ts +2 -0
- package/dist/components/stream/StreamTerminal.d.ts.map +1 -0
- package/dist/components/stream/StreamTerminal.js +52 -0
- package/dist/components/stream/StreamVoiceConfig.d.ts +10 -0
- package/dist/components/stream/StreamVoiceConfig.d.ts.map +1 -0
- package/dist/components/stream/StreamVoiceConfig.js +88 -0
- package/dist/components/stream/helpers.d.ts +32 -0
- package/dist/components/stream/helpers.d.ts.map +1 -0
- package/dist/components/stream/helpers.js +110 -0
- package/dist/components/stream/overlays/OverlayLayer.d.ts +20 -0
- package/dist/components/stream/overlays/OverlayLayer.d.ts.map +1 -0
- package/dist/components/stream/overlays/OverlayLayer.js +24 -0
- package/dist/components/stream/overlays/built-in/ActionTickerWidget.d.ts +8 -0
- package/dist/components/stream/overlays/built-in/ActionTickerWidget.d.ts.map +1 -0
- package/dist/components/stream/overlays/built-in/ActionTickerWidget.js +44 -0
- package/dist/components/stream/overlays/built-in/AlertPopupWidget.d.ts +7 -0
- package/dist/components/stream/overlays/built-in/AlertPopupWidget.d.ts.map +1 -0
- package/dist/components/stream/overlays/built-in/AlertPopupWidget.js +62 -0
- package/dist/components/stream/overlays/built-in/BrandingWidget.d.ts +7 -0
- package/dist/components/stream/overlays/built-in/BrandingWidget.d.ts.map +1 -0
- package/dist/components/stream/overlays/built-in/BrandingWidget.js +36 -0
- package/dist/components/stream/overlays/built-in/CustomHtmlWidget.d.ts +26 -0
- package/dist/components/stream/overlays/built-in/CustomHtmlWidget.d.ts.map +1 -0
- package/dist/components/stream/overlays/built-in/CustomHtmlWidget.js +78 -0
- package/dist/components/stream/overlays/built-in/PeonGlassWidget.d.ts +11 -0
- package/dist/components/stream/overlays/built-in/PeonGlassWidget.d.ts.map +1 -0
- package/dist/components/stream/overlays/built-in/PeonGlassWidget.js +188 -0
- package/dist/components/stream/overlays/built-in/PeonHudWidget.d.ts +10 -0
- package/dist/components/stream/overlays/built-in/PeonHudWidget.d.ts.map +1 -0
- package/dist/components/stream/overlays/built-in/PeonHudWidget.js +168 -0
- package/dist/components/stream/overlays/built-in/PeonSakuraWidget.d.ts +11 -0
- package/dist/components/stream/overlays/built-in/PeonSakuraWidget.d.ts.map +1 -0
- package/dist/components/stream/overlays/built-in/PeonSakuraWidget.js +213 -0
- package/dist/components/stream/overlays/built-in/ThoughtBubbleWidget.d.ts +8 -0
- package/dist/components/stream/overlays/built-in/ThoughtBubbleWidget.d.ts.map +1 -0
- package/dist/components/stream/overlays/built-in/ThoughtBubbleWidget.js +59 -0
- package/dist/components/stream/overlays/built-in/ViewerCountWidget.d.ts +7 -0
- package/dist/components/stream/overlays/built-in/ViewerCountWidget.d.ts.map +1 -0
- package/dist/components/stream/overlays/built-in/ViewerCountWidget.js +34 -0
- package/dist/components/stream/overlays/built-in/index.d.ts +13 -0
- package/dist/components/stream/overlays/built-in/index.d.ts.map +1 -0
- package/dist/components/stream/overlays/built-in/index.js +12 -0
- package/dist/components/stream/overlays/registry.d.ts +11 -0
- package/dist/components/stream/overlays/registry.d.ts.map +1 -0
- package/dist/components/stream/overlays/registry.js +16 -0
- package/dist/components/stream/overlays/types.d.ts +67 -0
- package/dist/components/stream/overlays/types.d.ts.map +1 -0
- package/dist/components/stream/overlays/types.js +7 -0
- package/dist/components/stream/overlays/useOverlayLayout.d.ts +27 -0
- package/dist/components/stream/overlays/useOverlayLayout.d.ts.map +1 -0
- package/dist/components/stream/overlays/useOverlayLayout.js +162 -0
- package/dist/components/trajectory-format.d.ts +6 -0
- package/dist/components/trajectory-format.d.ts.map +1 -0
- package/dist/components/trajectory-format.js +43 -0
- package/dist/components/ui-badges.d.ts +23 -0
- package/dist/components/ui-badges.d.ts.map +1 -0
- package/dist/components/ui-badges.js +38 -0
- package/dist/components/ui-switch.d.ts +14 -0
- package/dist/components/ui-switch.d.ts.map +1 -0
- package/dist/components/ui-switch.js +15 -0
- package/dist/components/vector-browser-three.d.ts +4 -0
- package/dist/components/vector-browser-three.d.ts.map +1 -0
- package/dist/components/vector-browser-three.js +19 -0
- package/dist/config/config-catalog.d.ts +376 -0
- package/dist/config/config-catalog.d.ts.map +1 -0
- package/dist/config/config-catalog.js +724 -0
- package/dist/config/config-field.d.ts +68 -0
- package/dist/config/config-field.d.ts.map +1 -0
- package/dist/config/config-field.js +821 -0
- package/dist/config/config-renderer.d.ts +176 -0
- package/dist/config/config-renderer.d.ts.map +1 -0
- package/dist/config/config-renderer.js +403 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +4 -0
- package/dist/config/ui-renderer.d.ts +26 -0
- package/dist/config/ui-renderer.d.ts.map +1 -0
- package/dist/config/ui-renderer.js +815 -0
- package/dist/config/ui-spec.d.ts +164 -0
- package/dist/config/ui-spec.d.ts.map +1 -0
- package/dist/config/ui-spec.js +13 -0
- package/dist/events/index.d.ts +42 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +41 -0
- package/dist/hooks/index.d.ts +14 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +13 -0
- package/dist/hooks/useBugReport.d.ts +14 -0
- package/dist/hooks/useBugReport.d.ts.map +1 -0
- package/dist/hooks/useBugReport.js +18 -0
- package/dist/hooks/useCanvasWindow.d.ts +38 -0
- package/dist/hooks/useCanvasWindow.d.ts.map +1 -0
- package/dist/hooks/useCanvasWindow.js +273 -0
- package/dist/hooks/useChatAvatarVoice.d.ts +10 -0
- package/dist/hooks/useChatAvatarVoice.d.ts.map +1 -0
- package/dist/hooks/useChatAvatarVoice.js +71 -0
- package/dist/hooks/useContextMenu.d.ts +17 -0
- package/dist/hooks/useContextMenu.d.ts.map +1 -0
- package/dist/hooks/useContextMenu.js +100 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts +17 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/dist/hooks/useKeyboardShortcuts.js +67 -0
- package/dist/hooks/useLifoSync.d.ts +18 -0
- package/dist/hooks/useLifoSync.d.ts.map +1 -0
- package/dist/hooks/useLifoSync.js +113 -0
- package/dist/hooks/useMemoryMonitor.d.ts +87 -0
- package/dist/hooks/useMemoryMonitor.d.ts.map +1 -0
- package/dist/hooks/useMemoryMonitor.js +210 -0
- package/dist/hooks/useRenderGuard.d.ts +17 -0
- package/dist/hooks/useRenderGuard.d.ts.map +1 -0
- package/dist/hooks/useRenderGuard.js +36 -0
- package/dist/hooks/useRetakeCapture.d.ts +12 -0
- package/dist/hooks/useRetakeCapture.d.ts.map +1 -0
- package/dist/hooks/useRetakeCapture.js +59 -0
- package/dist/hooks/useStreamPopoutNavigation.d.ts +3 -0
- package/dist/hooks/useStreamPopoutNavigation.d.ts.map +1 -0
- package/dist/hooks/useStreamPopoutNavigation.js +17 -0
- package/dist/hooks/useTimeout.d.ts +11 -0
- package/dist/hooks/useTimeout.d.ts.map +1 -0
- package/dist/hooks/useTimeout.js +32 -0
- package/dist/hooks/useVoiceChat.d.ts +129 -0
- package/dist/hooks/useVoiceChat.d.ts.map +1 -0
- package/dist/hooks/useVoiceChat.js +1071 -0
- package/dist/hooks/useWhatsAppPairing.d.ts +11 -0
- package/dist/hooks/useWhatsAppPairing.d.ts.map +1 -0
- package/dist/hooks/useWhatsAppPairing.js +95 -0
- package/dist/i18n/index.d.ts +7 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +53 -0
- package/dist/i18n/locales/en.json +1196 -0
- package/dist/i18n/locales/es.json +1196 -0
- package/dist/i18n/locales/ko.json +1196 -0
- package/dist/i18n/locales/pt.json +1196 -0
- package/dist/i18n/locales/zh-CN.json +1196 -0
- package/dist/i18n/messages.d.ts +6 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +14 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/navigation/index.d.ts +27 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +230 -0
- package/dist/package.json +161 -0
- package/dist/platform/browser-launch.d.ts +2 -0
- package/dist/platform/browser-launch.d.ts.map +1 -0
- package/dist/platform/browser-launch.js +109 -0
- package/dist/platform/index.d.ts +64 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/index.js +155 -0
- package/dist/platform/init.d.ts +40 -0
- package/dist/platform/init.d.ts.map +1 -0
- package/dist/platform/init.js +158 -0
- package/dist/providers/index.d.ts +13 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +72 -0
- package/dist/state/AppContext.d.ts +11 -0
- package/dist/state/AppContext.d.ts.map +1 -0
- package/dist/state/AppContext.js +4496 -0
- package/dist/state/index.d.ts +7 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +6 -0
- package/dist/state/internal.d.ts +6 -0
- package/dist/state/internal.d.ts.map +1 -0
- package/dist/state/internal.js +5 -0
- package/dist/state/parsers.d.ts +26 -0
- package/dist/state/parsers.d.ts.map +1 -0
- package/dist/state/parsers.js +255 -0
- package/dist/state/persistence.d.ts +36 -0
- package/dist/state/persistence.d.ts.map +1 -0
- package/dist/state/persistence.js +254 -0
- package/dist/state/types.d.ts +402 -0
- package/dist/state/types.d.ts.map +1 -0
- package/dist/state/types.js +70 -0
- package/dist/state/ui-preferences.d.ts +3 -0
- package/dist/state/ui-preferences.d.ts.map +1 -0
- package/dist/state/ui-preferences.js +1 -0
- package/dist/state/useApp.d.ts +4 -0
- package/dist/state/useApp.d.ts.map +1 -0
- package/dist/state/useApp.js +22 -0
- package/dist/state/vrm.d.ts +19 -0
- package/dist/state/vrm.d.ts.map +1 -0
- package/dist/state/vrm.js +65 -0
- package/dist/stories/AppMockProvider.d.ts +15 -0
- package/dist/stories/AppMockProvider.d.ts.map +1 -0
- package/dist/stories/AppMockProvider.js +14 -0
- package/dist/styles/anime.css +6324 -0
- package/dist/styles/base.css +196 -0
- package/dist/styles/onboarding-game.css +716 -0
- package/dist/styles/styles.css +2085 -0
- package/dist/styles/xterm.css +241 -0
- package/dist/types/index.d.ts +657 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/utils/asset-url.d.ts +26 -0
- package/dist/utils/asset-url.d.ts.map +1 -0
- package/dist/utils/asset-url.js +99 -0
- package/dist/utils/assistant-text.d.ts +2 -0
- package/dist/utils/assistant-text.d.ts.map +1 -0
- package/dist/utils/assistant-text.js +161 -0
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +38 -0
- package/dist/utils/desktop-dialogs.d.ts +19 -0
- package/dist/utils/desktop-dialogs.d.ts.map +1 -0
- package/dist/utils/desktop-dialogs.js +50 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/number-parsing.d.ts +44 -0
- package/dist/utils/number-parsing.d.ts.map +1 -0
- package/dist/utils/number-parsing.js +56 -0
- package/dist/utils/openExternalUrl.d.ts +2 -0
- package/dist/utils/openExternalUrl.d.ts.map +1 -0
- package/dist/utils/openExternalUrl.js +17 -0
- package/dist/utils/spoken-text.d.ts +2 -0
- package/dist/utils/spoken-text.d.ts.map +1 -0
- package/dist/utils/spoken-text.js +56 -0
- package/dist/utils/streaming-text.d.ts +3 -0
- package/dist/utils/streaming-text.d.ts.map +1 -0
- package/dist/utils/streaming-text.js +87 -0
- package/dist/voice/index.d.ts +2 -0
- package/dist/voice/index.d.ts.map +1 -0
- package/dist/voice/index.js +1 -0
- package/dist/voice/types.d.ts +25 -0
- package/dist/voice/types.d.ts.map +1 -0
- package/dist/voice/types.js +166 -0
- package/package.json +86 -0
- package/src/App.tsx +469 -0
- package/src/actions/character.ts +113 -0
- package/src/actions/chat-helpers.ts +100 -0
- package/src/actions/cloud.ts +59 -0
- package/src/actions/index.ts +12 -0
- package/src/actions/lifecycle.ts +175 -0
- package/src/actions/onboarding.ts +46 -0
- package/src/actions/triggers.ts +190 -0
- package/src/ambient.d.ts +16 -0
- package/src/api/client.ts +5616 -0
- package/src/api/index.ts +1 -0
- package/src/autonomy/index.ts +477 -0
- package/src/bridge/capacitor-bridge.ts +295 -0
- package/src/bridge/electrobun-rpc.ts +58 -0
- package/src/bridge/electrobun-runtime.ts +28 -0
- package/src/bridge/index.ts +5 -0
- package/src/bridge/native-plugins.ts +134 -0
- package/src/bridge/plugin-bridge.ts +352 -0
- package/src/bridge/storage-bridge.ts +162 -0
- package/src/chat/index.ts +251 -0
- package/src/coding/index.ts +43 -0
- package/src/components/AdvancedPageView.tsx +362 -0
- package/src/components/AgentActivityBox.tsx +49 -0
- package/src/components/ApiKeyConfig.tsx +224 -0
- package/src/components/AppsPageView.tsx +52 -0
- package/src/components/AppsView.tsx +293 -0
- package/src/components/AvatarLoader.tsx +86 -0
- package/src/components/AvatarSelector.tsx +223 -0
- package/src/components/BscTradePanel.tsx +549 -0
- package/src/components/BugReportModal.tsx +499 -0
- package/src/components/CharacterView.tsx +1623 -0
- package/src/components/ChatAvatar.test.ts +96 -0
- package/src/components/ChatAvatar.tsx +147 -0
- package/src/components/ChatComposer.tsx +330 -0
- package/src/components/ChatMessage.tsx +448 -0
- package/src/components/ChatModalView.test.tsx +118 -0
- package/src/components/ChatModalView.tsx +125 -0
- package/src/components/ChatView.tsx +999 -0
- package/src/components/CloudSourceControls.tsx +80 -0
- package/src/components/CodingAgentSettingsSection.tsx +536 -0
- package/src/components/CommandPalette.tsx +284 -0
- package/src/components/CompanionSceneHost.tsx +498 -0
- package/src/components/CompanionShell.tsx +31 -0
- package/src/components/CompanionView.tsx +109 -0
- package/src/components/ConfigPageView.tsx +722 -0
- package/src/components/ConfigSaveFooter.tsx +41 -0
- package/src/components/ConfirmModal.tsx +379 -0
- package/src/components/ConnectionFailedBanner.tsx +91 -0
- package/src/components/ConnectorsPageView.tsx +13 -0
- package/src/components/ConversationsSidebar.tsx +279 -0
- package/src/components/CustomActionEditor.tsx +1125 -0
- package/src/components/CustomActionsPanel.tsx +288 -0
- package/src/components/CustomActionsView.tsx +322 -0
- package/src/components/DatabasePageView.tsx +55 -0
- package/src/components/DatabaseView.tsx +814 -0
- package/src/components/ElizaCloudDashboard.tsx +1696 -0
- package/src/components/EmotePicker.tsx +529 -0
- package/src/components/ErrorBoundary.tsx +76 -0
- package/src/components/FineTuningView.tsx +1080 -0
- package/src/components/GameView.tsx +551 -0
- package/src/components/GameViewOverlay.tsx +133 -0
- package/src/components/GlobalEmoteOverlay.tsx +152 -0
- package/src/components/Header.test.tsx +413 -0
- package/src/components/Header.tsx +400 -0
- package/src/components/HeartbeatsView.tsx +1002 -0
- package/src/components/InventoryView.tsx +372 -0
- package/src/components/KnowledgeView.tsx +1128 -0
- package/src/components/LanguageDropdown.tsx +187 -0
- package/src/components/LifoMonitorPanel.tsx +196 -0
- package/src/components/LifoSandboxView.tsx +499 -0
- package/src/components/LoadingScreen.tsx +77 -0
- package/src/components/LogsPageView.tsx +17 -0
- package/src/components/LogsView.tsx +239 -0
- package/src/components/MediaGalleryView.tsx +432 -0
- package/src/components/MediaSettingsSection.tsx +893 -0
- package/src/components/MessageContent.tsx +815 -0
- package/src/components/OnboardingWizard.test.tsx +107 -0
- package/src/components/OnboardingWizard.tsx +186 -0
- package/src/components/PairingView.tsx +110 -0
- package/src/components/PermissionsSection.tsx +818 -0
- package/src/components/PluginsPageView.tsx +9 -0
- package/src/components/PluginsView.tsx +3152 -0
- package/src/components/ProviderSwitcher.tsx +874 -0
- package/src/components/RestartBanner.tsx +76 -0
- package/src/components/RuntimeView.tsx +460 -0
- package/src/components/SaveCommandModal.tsx +211 -0
- package/src/components/SecretsView.tsx +569 -0
- package/src/components/SettingsView.tsx +825 -0
- package/src/components/ShellOverlays.tsx +41 -0
- package/src/components/ShortcutsOverlay.tsx +155 -0
- package/src/components/SkillsView.tsx +1435 -0
- package/src/components/StartupFailureView.tsx +63 -0
- package/src/components/StreamView.tsx +483 -0
- package/src/components/StripeEmbeddedCheckout.tsx +155 -0
- package/src/components/SubscriptionStatus.tsx +634 -0
- package/src/components/SystemWarningBanner.tsx +71 -0
- package/src/components/ThemeToggle.tsx +100 -0
- package/src/components/TrajectoriesView.tsx +526 -0
- package/src/components/TrajectoryDetailView.tsx +426 -0
- package/src/components/TriggersView.tsx +1 -0
- package/src/components/VectorBrowserView.tsx +1633 -0
- package/src/components/VoiceConfigView.tsx +674 -0
- package/src/components/VrmStage.test.ts +219 -0
- package/src/components/VrmStage.tsx +432 -0
- package/src/components/WhatsAppQrOverlay.tsx +230 -0
- package/src/components/__tests__/chainConfig.test.ts +220 -0
- package/src/components/apps/AppDetailPane.tsx +242 -0
- package/src/components/apps/AppsCatalogGrid.tsx +137 -0
- package/src/components/apps/extensions/HyperscapeAppDetailPanel.tsx +577 -0
- package/src/components/apps/extensions/registry.ts +16 -0
- package/src/components/apps/extensions/types.ts +9 -0
- package/src/components/apps/helpers.ts +44 -0
- package/src/components/avatar/VrmAnimationLoader.test.ts +164 -0
- package/src/components/avatar/VrmAnimationLoader.ts +151 -0
- package/src/components/avatar/VrmBlinkController.ts +118 -0
- package/src/components/avatar/VrmCameraManager.ts +407 -0
- package/src/components/avatar/VrmEngine.ts +2678 -0
- package/src/components/avatar/VrmFootShadow.ts +96 -0
- package/src/components/avatar/VrmViewer.tsx +421 -0
- package/src/components/avatar/__tests__/VrmCameraManager.test.ts +168 -0
- package/src/components/avatar/__tests__/VrmEngine.test.ts +1574 -0
- package/src/components/avatar/mixamoVRMRigMap.ts +62 -0
- package/src/components/avatar/retargetMixamoFbxToVrm.ts +144 -0
- package/src/components/avatar/retargetMixamoGltfToVrm.ts +119 -0
- package/src/components/chainConfig.ts +380 -0
- package/src/components/companion/CompanionHeader.tsx +47 -0
- package/src/components/companion/CompanionSceneHost.tsx +5 -0
- package/src/components/companion/VrmStage.tsx +2 -0
- package/src/components/companion/__tests__/walletUtils.test.ts +742 -0
- package/src/components/companion/walletUtils.ts +290 -0
- package/src/components/companion-shell-styles.test.ts +146 -0
- package/src/components/companion-shell-styles.ts +270 -0
- package/src/components/confirm-delete-control.tsx +69 -0
- package/src/components/conversations/ConversationListItem.tsx +185 -0
- package/src/components/conversations/conversation-utils.ts +151 -0
- package/src/components/format.ts +131 -0
- package/src/components/index.ts +92 -0
- package/src/components/inventory/CopyableAddress.tsx +41 -0
- package/src/components/inventory/InventoryToolbar.tsx +142 -0
- package/src/components/inventory/NftGrid.tsx +99 -0
- package/src/components/inventory/TokenLogo.tsx +71 -0
- package/src/components/inventory/TokensTable.tsx +216 -0
- package/src/components/inventory/constants.ts +170 -0
- package/src/components/inventory/index.ts +29 -0
- package/src/components/inventory/media-url.test.ts +38 -0
- package/src/components/inventory/media-url.ts +36 -0
- package/src/components/inventory/useInventoryData.ts +460 -0
- package/src/components/knowledge-upload-image.ts +215 -0
- package/src/components/labels.ts +46 -0
- package/src/components/onboarding/ActivateStep.tsx +30 -0
- package/src/components/onboarding/ConnectionStep.tsx +1530 -0
- package/src/components/onboarding/OnboardingPanel.tsx +39 -0
- package/src/components/onboarding/OnboardingStepNav.tsx +31 -0
- package/src/components/onboarding/PermissionsStep.tsx +20 -0
- package/src/components/onboarding/RpcStep.tsx +402 -0
- package/src/components/onboarding/WakeUpStep.tsx +184 -0
- package/src/components/permissions/PermissionIcon.tsx +25 -0
- package/src/components/permissions/StreamingPermissions.tsx +376 -0
- package/src/components/plugins/showcase-data.ts +481 -0
- package/src/components/shared/ShellHeaderControls.tsx +193 -0
- package/src/components/skeletons.tsx +88 -0
- package/src/components/stream/ActivityFeed.tsx +113 -0
- package/src/components/stream/AvatarPip.tsx +10 -0
- package/src/components/stream/ChatContent.tsx +126 -0
- package/src/components/stream/ChatTicker.tsx +55 -0
- package/src/components/stream/IdleContent.tsx +73 -0
- package/src/components/stream/StatusBar.tsx +469 -0
- package/src/components/stream/StreamSettings.tsx +506 -0
- package/src/components/stream/StreamTerminal.tsx +94 -0
- package/src/components/stream/StreamVoiceConfig.tsx +160 -0
- package/src/components/stream/helpers.ts +134 -0
- package/src/components/stream/overlays/OverlayLayer.tsx +75 -0
- package/src/components/stream/overlays/built-in/ActionTickerWidget.tsx +64 -0
- package/src/components/stream/overlays/built-in/AlertPopupWidget.tsx +87 -0
- package/src/components/stream/overlays/built-in/BrandingWidget.tsx +51 -0
- package/src/components/stream/overlays/built-in/CustomHtmlWidget.tsx +105 -0
- package/src/components/stream/overlays/built-in/PeonGlassWidget.tsx +265 -0
- package/src/components/stream/overlays/built-in/PeonHudWidget.tsx +247 -0
- package/src/components/stream/overlays/built-in/PeonSakuraWidget.tsx +278 -0
- package/src/components/stream/overlays/built-in/ThoughtBubbleWidget.tsx +77 -0
- package/src/components/stream/overlays/built-in/ViewerCountWidget.tsx +46 -0
- package/src/components/stream/overlays/built-in/index.ts +13 -0
- package/src/components/stream/overlays/registry.ts +22 -0
- package/src/components/stream/overlays/types.ts +90 -0
- package/src/components/stream/overlays/useOverlayLayout.ts +218 -0
- package/src/components/trajectory-format.ts +50 -0
- package/src/components/ui-badges.tsx +109 -0
- package/src/components/ui-switch.tsx +57 -0
- package/src/components/vector-browser-three.ts +27 -0
- package/src/config/config-catalog.ts +1092 -0
- package/src/config/config-field.tsx +1900 -0
- package/src/config/config-renderer.tsx +730 -0
- package/src/config/index.ts +11 -0
- package/src/config/ui-renderer.tsx +1751 -0
- package/src/config/ui-spec.ts +256 -0
- package/src/events/index.ts +89 -0
- package/src/hooks/index.ts +13 -0
- package/src/hooks/useBugReport.tsx +43 -0
- package/src/hooks/useCanvasWindow.ts +372 -0
- package/src/hooks/useChatAvatarVoice.ts +111 -0
- package/src/hooks/useContextMenu.ts +127 -0
- package/src/hooks/useKeyboardShortcuts.ts +86 -0
- package/src/hooks/useLifoSync.ts +143 -0
- package/src/hooks/useMemoryMonitor.ts +335 -0
- package/src/hooks/useRenderGuard.ts +43 -0
- package/src/hooks/useRetakeCapture.ts +67 -0
- package/src/hooks/useStreamPopoutNavigation.ts +27 -0
- package/src/hooks/useTimeout.ts +37 -0
- package/src/hooks/useVoiceChat.ts +1443 -0
- package/src/hooks/useWhatsAppPairing.ts +123 -0
- package/src/i18n/index.ts +76 -0
- package/src/i18n/locales/en.json +1196 -0
- package/src/i18n/locales/es.json +1196 -0
- package/src/i18n/locales/ko.json +1196 -0
- package/src/i18n/locales/pt.json +1196 -0
- package/src/i18n/locales/zh-CN.json +1196 -0
- package/src/i18n/messages.ts +21 -0
- package/src/index.ts +6 -0
- package/src/navigation/index.ts +282 -0
- package/src/navigation.test.ts +189 -0
- package/src/platform/browser-launch.test.ts +94 -0
- package/src/platform/browser-launch.ts +149 -0
- package/src/platform/index.ts +261 -0
- package/src/platform/init.ts +236 -0
- package/src/providers/index.ts +82 -0
- package/src/state/AppContext.tsx +5737 -0
- package/src/state/index.ts +6 -0
- package/src/state/internal.ts +77 -0
- package/src/state/parsers.test.ts +124 -0
- package/src/state/parsers.ts +309 -0
- package/src/state/persistence.ts +278 -0
- package/src/state/types.ts +694 -0
- package/src/state/ui-preferences.ts +3 -0
- package/src/state/useApp.ts +23 -0
- package/src/state/vrm.ts +76 -0
- package/src/stories/AppMockProvider.tsx +32 -0
- package/src/stories/ChatEmptyState.stories.tsx +27 -0
- package/src/stories/ChatMessage.stories.tsx +115 -0
- package/src/stories/CompanionHeader.stories.tsx +74 -0
- package/src/stories/CompanionView.stories.tsx +33 -0
- package/src/stories/ConversationListItem.stories.tsx +102 -0
- package/src/stories/TypingIndicator.stories.tsx +28 -0
- package/src/styles/anime.css +6324 -0
- package/src/styles/base.css +196 -0
- package/src/styles/onboarding-game.css +716 -0
- package/src/styles/styles.css +2085 -0
- package/src/styles/xterm.css +241 -0
- package/src/types/index.ts +715 -0
- package/src/types/react-test-renderer.d.ts +45 -0
- package/src/utils/asset-url.ts +110 -0
- package/src/utils/assistant-text.ts +172 -0
- package/src/utils/clipboard.ts +41 -0
- package/src/utils/desktop-dialogs.ts +80 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/number-parsing.ts +125 -0
- package/src/utils/openExternalUrl.ts +20 -0
- package/src/utils/spoken-text.ts +65 -0
- package/src/utils/streaming-text.ts +120 -0
- package/src/voice/index.ts +1 -0
- package/src/voice/types.ts +197 -0
- package/test/app/AppContext.pty-sessions.test.tsx +143 -0
- package/test/app/MessageContent.test.tsx +326 -0
- package/test/app/PermissionsOnboarding.test.tsx +216 -0
- package/test/app/PermissionsSection.test.tsx +186 -0
- package/test/app/advanced-trajectory-fine-tuning.e2e.test.ts +397 -0
- package/test/app/agent-activity-box.test.tsx +132 -0
- package/test/app/agent-transfer-lock.test.ts +274 -0
- package/test/app/api-client-electron-fallback.test.ts +139 -0
- package/test/app/api-client-timeout.test.ts +75 -0
- package/test/app/api-client-ws.test.ts +98 -0
- package/test/app/api-client.ws-max-reconnect.test.ts +139 -0
- package/test/app/api-client.ws-reconnect.test.ts +157 -0
- package/test/app/app-context-autonomy-events.test.ts +478 -0
- package/test/app/apps-page-view.test.ts +114 -0
- package/test/app/apps-view.test.ts +769 -0
- package/test/app/autonomous-workflows.e2e.test.ts +765 -0
- package/test/app/autonomy-events.test.ts +150 -0
- package/test/app/avatar-selector.test.tsx +52 -0
- package/test/app/bsc-trade-panel.test.tsx +134 -0
- package/test/app/bug-report-modal.test.tsx +353 -0
- package/test/app/character-customization.e2e.test.ts +1168 -0
- package/test/app/chat-advanced-features.e2e.test.ts +706 -0
- package/test/app/chat-composer.test.tsx +181 -0
- package/test/app/chat-language-header.test.ts +64 -0
- package/test/app/chat-message.test.tsx +222 -0
- package/test/app/chat-modal-view.test.tsx +191 -0
- package/test/app/chat-routine-filter.test.ts +96 -0
- package/test/app/chat-send-lock.test.ts +1302 -0
- package/test/app/chat-stream-api-client.test.tsx +390 -0
- package/test/app/chat-view-game-modal.test.tsx +661 -0
- package/test/app/chat-view.test.tsx +877 -0
- package/test/app/cloud-api.e2e.test.ts +258 -0
- package/test/app/cloud-login-flow.e2e.test.ts +494 -0
- package/test/app/cloud-login-lock.test.ts +411 -0
- package/test/app/command-palette.test.tsx +184 -0
- package/test/app/command-registry.test.ts +75 -0
- package/test/app/companion-greeting-wave.test.tsx +443 -0
- package/test/app/companion-stale-conversation.test.tsx +424 -0
- package/test/app/companion-view.test.tsx +686 -0
- package/test/app/confirm-delete-control.test.ts +79 -0
- package/test/app/confirm-modal.test.tsx +219 -0
- package/test/app/connectors-ui.e2e.test.ts +508 -0
- package/test/app/conversations-sidebar-game-modal.test.tsx +260 -0
- package/test/app/conversations-sidebar.test.tsx +160 -0
- package/test/app/custom-actions-smoke.test.ts +387 -0
- package/test/app/custom-avatar-api-client.test.ts +207 -0
- package/test/app/desktop-utils.test.ts +145 -0
- package/test/app/electrobun-rpc-bridge.test.ts +83 -0
- package/test/app/events.test.ts +88 -0
- package/test/app/export-import-flows.e2e.test.ts +700 -0
- package/test/app/fine-tuning-view.test.ts +471 -0
- package/test/app/game-view-auth-session.test.tsx +186 -0
- package/test/app/game-view.test.ts +444 -0
- package/test/app/global-emote-overlay.test.tsx +106 -0
- package/test/app/header-status.test.tsx +149 -0
- package/test/app/i18n.test.ts +152 -0
- package/test/app/inventory-bsc-view.test.ts +908 -0
- package/test/app/knowledge-ui.e2e.test.ts +762 -0
- package/test/app/knowledge-upload-helpers.test.ts +124 -0
- package/test/app/lifecycle-lock.test.ts +267 -0
- package/test/app/lifo-popout-utils.test.ts +208 -0
- package/test/app/lifo-safe-endpoint.test.ts +34 -0
- package/test/app/loading-screen.test.tsx +45 -0
- package/test/app/memory-monitor.test.ts +332 -0
- package/test/app/navigation.test.tsx +29 -0
- package/test/app/onboarding-finish-lock.test.ts +500 -0
- package/test/app/onboarding-language.test.tsx +161 -0
- package/test/app/onboarding-steps.test.tsx +371 -0
- package/test/app/open-external-url.test.ts +65 -0
- package/test/app/pages-navigation-smoke.e2e.test.ts +633 -0
- package/test/app/pairing-lock.test.ts +260 -0
- package/test/app/pairing-view.test.tsx +74 -0
- package/test/app/permissions-section.test.ts +432 -0
- package/test/app/plugin-bridge.test.ts +109 -0
- package/test/app/plugins-ui.e2e.test.ts +605 -0
- package/test/app/plugins-view-game-modal.test.tsx +650 -0
- package/test/app/plugins-view-toggle-restart.test.ts +129 -0
- package/test/app/provider-dropdown-default.test.tsx +164 -0
- package/test/app/restart-banner.test.tsx +197 -0
- package/test/app/retake-capture.test.ts +84 -0
- package/test/app/sandbox-api-client.test.ts +108 -0
- package/test/app/save-command-modal.test.tsx +109 -0
- package/test/app/secrets-view.test.tsx +92 -0
- package/test/app/settings-control-styles.test.tsx +142 -0
- package/test/app/settings-reset.e2e.test.ts +728 -0
- package/test/app/settings-sections.e2e.test.ts +614 -0
- package/test/app/shared-format.test.ts +44 -0
- package/test/app/shared-switch.test.ts +69 -0
- package/test/app/shell-mode-switching.e2e.test.ts +829 -0
- package/test/app/shell-mode-tab-memory.test.tsx +283 -0
- package/test/app/shell-overlays.test.tsx +50 -0
- package/test/app/shortcuts-overlay.test.tsx +111 -0
- package/test/app/sse-interruption.test.ts +122 -0
- package/test/app/startup-asset-missing.e2e.test.ts +126 -0
- package/test/app/startup-backend-missing.e2e.test.ts +118 -0
- package/test/app/startup-chat.e2e.test.ts +305 -0
- package/test/app/startup-conversation-restore.test.tsx +344 -0
- package/test/app/startup-failure-view.test.tsx +103 -0
- package/test/app/startup-onboarding.e2e.test.ts +612 -0
- package/test/app/startup-timeout.test.tsx +80 -0
- package/test/app/startup-token-401.e2e.test.ts +103 -0
- package/test/app/stream-helpers.test.ts +46 -0
- package/test/app/stream-popout-navigation.test.tsx +41 -0
- package/test/app/stream-status-bar.test.tsx +89 -0
- package/test/app/theme-toggle.test.tsx +33 -0
- package/test/app/training-api-client.test.ts +128 -0
- package/test/app/trajectories-view.test.tsx +220 -0
- package/test/app/triggers-api-client.test.ts +77 -0
- package/test/app/triggers-navigation.test.ts +118 -0
- package/test/app/triggers-view.e2e.test.ts +674 -0
- package/test/app/update-channel-lock.test.ts +259 -0
- package/test/app/vector-browser.async-cleanup.test.tsx +367 -0
- package/test/app/vector-browser.e2e.test.ts +653 -0
- package/test/app/vrm-stage.test.tsx +351 -0
- package/test/app/vrm-viewer.test.tsx +298 -0
- package/test/app/wallet-api-save-lock.test.ts +277 -0
- package/test/app/wallet-hooks.test.ts +405 -0
- package/test/app/wallet-ui-flows.e2e.test.ts +556 -0
- package/test/avatar/asset-url.test.ts +90 -0
- package/test/avatar/avatar-selector.test.ts +173 -0
- package/test/avatar/mixamo-vrm-rig-map.test.ts +111 -0
- package/test/avatar/voice-chat-streaming-text.test.ts +96 -0
- package/test/avatar/voice-chat.test.ts +391 -0
- package/test/ui/command-palette-commands.test.ts +57 -0
- package/test/ui/ui-renderer.test.ts +39 -0
- package/tsconfig.build.json +19 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,1531 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Plugins view — tag-filtered plugin management.
|
|
4
|
+
*
|
|
5
|
+
* Renders a unified plugin list with searchable/filterable cards and per-plugin settings.
|
|
6
|
+
*/
|
|
7
|
+
import { Button, Input } from "@elizaos/ui";
|
|
8
|
+
import { Binary, BookOpen, Bot, Brain, BrickWall, Briefcase, Calendar, ChevronRight, Chrome, Circle, CircleDashed, CircleDot, ClipboardList, Clock, Cloud, Command, Construction, CreditCard, Diamond, Dna, Droplets, Eye, Feather, FileKey, FileText, Fingerprint, Gamepad, Gamepad2, Github, Handshake, Hash, Layers, Leaf, Link, Lock, LockKeyhole, Mail, MessageCircle, MessageSquare, MessagesSquare, Mic, Monitor, MousePointer2, Package, PenTool, Phone, Pickaxe, Puzzle, RefreshCw, Rss, ScrollText, Send, Server, Settings, Shell, Shuffle, Smartphone, Sparkle, Sparkles, Square, Star, StickyNote, Target, Tornado, TrendingDown, Triangle, Twitter, Video, Volume2, Wallet, Webhook, Wrench, Zap, } from "lucide-react";
|
|
9
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
10
|
+
import { client } from "../api";
|
|
11
|
+
import { ConfigRenderer, defaultRegistry, } from "../config";
|
|
12
|
+
import { useApp } from "../state";
|
|
13
|
+
import { openExternalUrl, resolveAppAssetUrl } from "../utils";
|
|
14
|
+
import { autoLabel } from "./labels";
|
|
15
|
+
import { SHOWCASE_PLUGIN } from "./plugins/showcase-data";
|
|
16
|
+
import { WhatsAppQrOverlay } from "./WhatsAppQrOverlay";
|
|
17
|
+
/* ── Always-on plugins (hidden from all views) ────────────────────────── */
|
|
18
|
+
/**
|
|
19
|
+
* Plugin IDs hidden from Features/Connectors views.
|
|
20
|
+
* Core plugins are visible in Admin > Plugins instead.
|
|
21
|
+
*/
|
|
22
|
+
const ALWAYS_ON_PLUGIN_IDS = new Set([
|
|
23
|
+
// Core (always loaded)
|
|
24
|
+
"sql",
|
|
25
|
+
"local-embedding",
|
|
26
|
+
"knowledge",
|
|
27
|
+
"agent-skills",
|
|
28
|
+
"directives",
|
|
29
|
+
"commands",
|
|
30
|
+
"personality",
|
|
31
|
+
"experience",
|
|
32
|
+
// Optional core (shown in admin)
|
|
33
|
+
"agent-orchestrator",
|
|
34
|
+
"shell",
|
|
35
|
+
"plugin-manager",
|
|
36
|
+
"cli",
|
|
37
|
+
"code",
|
|
38
|
+
"edge-tts",
|
|
39
|
+
"pdf",
|
|
40
|
+
"scratchpad",
|
|
41
|
+
"secrets-manager",
|
|
42
|
+
"todo",
|
|
43
|
+
"trust",
|
|
44
|
+
"form",
|
|
45
|
+
"goals",
|
|
46
|
+
"scheduling",
|
|
47
|
+
// Internal / infrastructure
|
|
48
|
+
"elizacloud",
|
|
49
|
+
"evm",
|
|
50
|
+
"memory",
|
|
51
|
+
"rolodex",
|
|
52
|
+
"tts",
|
|
53
|
+
"elevenlabs",
|
|
54
|
+
"cron",
|
|
55
|
+
"webhooks",
|
|
56
|
+
"browser",
|
|
57
|
+
"vision",
|
|
58
|
+
"computeruse",
|
|
59
|
+
]);
|
|
60
|
+
/* ── Helpers ────────────────────────────────────────────────────────── */
|
|
61
|
+
/** Detect advanced / debug parameters that should be collapsed by default. */
|
|
62
|
+
function isAdvancedParam(param) {
|
|
63
|
+
const k = param.key.toUpperCase();
|
|
64
|
+
const d = (param.description ?? "").toLowerCase();
|
|
65
|
+
return (k.includes("EXPERIMENTAL") ||
|
|
66
|
+
k.includes("DEBUG") ||
|
|
67
|
+
k.includes("VERBOSE") ||
|
|
68
|
+
k.includes("TELEMETRY") ||
|
|
69
|
+
k.includes("BROWSER_BASE") ||
|
|
70
|
+
d.includes("experimental") ||
|
|
71
|
+
d.includes("advanced") ||
|
|
72
|
+
d.includes("debug"));
|
|
73
|
+
}
|
|
74
|
+
/** Convert PluginParamDef[] to a JSON Schema + ConfigUiHints for ConfigRenderer. */
|
|
75
|
+
export function paramsToSchema(params, pluginId) {
|
|
76
|
+
const properties = {};
|
|
77
|
+
const required = [];
|
|
78
|
+
const hints = {};
|
|
79
|
+
for (const p of params) {
|
|
80
|
+
// Build JSON Schema property
|
|
81
|
+
const prop = {};
|
|
82
|
+
if (p.type === "boolean") {
|
|
83
|
+
prop.type = "boolean";
|
|
84
|
+
}
|
|
85
|
+
else if (p.type === "number") {
|
|
86
|
+
prop.type = "number";
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
prop.type = "string";
|
|
90
|
+
}
|
|
91
|
+
if (p.description)
|
|
92
|
+
prop.description = p.description;
|
|
93
|
+
if (p.default != null)
|
|
94
|
+
prop.default = p.default;
|
|
95
|
+
if (p.options?.length) {
|
|
96
|
+
prop.enum = p.options;
|
|
97
|
+
}
|
|
98
|
+
// Auto-detect format from key name
|
|
99
|
+
const keyUpper = p.key.toUpperCase();
|
|
100
|
+
if (keyUpper.includes("URL") ||
|
|
101
|
+
keyUpper.includes("ENDPOINT") ||
|
|
102
|
+
keyUpper.includes("BASE_URL")) {
|
|
103
|
+
prop.format = "uri";
|
|
104
|
+
}
|
|
105
|
+
else if (keyUpper.includes("EMAIL")) {
|
|
106
|
+
prop.format = "email";
|
|
107
|
+
}
|
|
108
|
+
else if (keyUpper.includes("_DATE") ||
|
|
109
|
+
keyUpper.includes("_SINCE") ||
|
|
110
|
+
keyUpper.includes("_UNTIL")) {
|
|
111
|
+
prop.format = "date";
|
|
112
|
+
}
|
|
113
|
+
// Auto-detect number types from key patterns
|
|
114
|
+
if (keyUpper.includes("PORT") && prop.type === "string") {
|
|
115
|
+
prop.type = "number";
|
|
116
|
+
}
|
|
117
|
+
else if ((keyUpper.includes("TIMEOUT") ||
|
|
118
|
+
keyUpper.includes("INTERVAL") ||
|
|
119
|
+
keyUpper.includes("_MS")) &&
|
|
120
|
+
prop.type === "string") {
|
|
121
|
+
prop.type = "number";
|
|
122
|
+
}
|
|
123
|
+
else if ((keyUpper.includes("COUNT") ||
|
|
124
|
+
keyUpper.includes("LIMIT") ||
|
|
125
|
+
keyUpper.startsWith("MAX_")) &&
|
|
126
|
+
prop.type === "string") {
|
|
127
|
+
prop.type = "number";
|
|
128
|
+
}
|
|
129
|
+
else if ((keyUpper.includes("RETRY") || keyUpper.includes("RETRIES")) &&
|
|
130
|
+
prop.type === "string") {
|
|
131
|
+
prop.type = "number";
|
|
132
|
+
}
|
|
133
|
+
// Auto-detect boolean from key patterns
|
|
134
|
+
if (prop.type === "string" &&
|
|
135
|
+
(keyUpper.includes("SHOULD_") ||
|
|
136
|
+
keyUpper.endsWith("_ENABLED") ||
|
|
137
|
+
keyUpper.endsWith("_DISABLED") ||
|
|
138
|
+
keyUpper.startsWith("USE_") ||
|
|
139
|
+
keyUpper.startsWith("ALLOW_") ||
|
|
140
|
+
keyUpper.startsWith("IS_") ||
|
|
141
|
+
keyUpper.startsWith("ENABLE_") ||
|
|
142
|
+
keyUpper.startsWith("DISABLE_") ||
|
|
143
|
+
keyUpper.startsWith("FORCE_") ||
|
|
144
|
+
keyUpper.endsWith("_AUTONOMOUS_MODE"))) {
|
|
145
|
+
prop.type = "boolean";
|
|
146
|
+
}
|
|
147
|
+
// Auto-detect number from key patterns (RATE, DELAY, THRESHOLD, SIZE, TEMPERATURE)
|
|
148
|
+
if (prop.type === "string" &&
|
|
149
|
+
(keyUpper.includes("_RATE") ||
|
|
150
|
+
keyUpper.includes("DELAY") ||
|
|
151
|
+
keyUpper.includes("THRESHOLD") ||
|
|
152
|
+
keyUpper.includes("_SIZE") ||
|
|
153
|
+
keyUpper.includes("TEMPERATURE") ||
|
|
154
|
+
keyUpper.includes("_DEPTH") ||
|
|
155
|
+
keyUpper.includes("_PERCENT") ||
|
|
156
|
+
keyUpper.includes("_RATIO"))) {
|
|
157
|
+
prop.type = "number";
|
|
158
|
+
}
|
|
159
|
+
// Auto-detect comma-separated lists → array renderer
|
|
160
|
+
if (prop.type === "string" && !prop.enum) {
|
|
161
|
+
const descLower = (p.description || "").toLowerCase();
|
|
162
|
+
const isCommaSep = descLower.includes("comma-separated") ||
|
|
163
|
+
descLower.includes("comma separated");
|
|
164
|
+
const isListSuffix = keyUpper.endsWith("_IDS") ||
|
|
165
|
+
keyUpper.endsWith("_CHANNELS") ||
|
|
166
|
+
keyUpper.endsWith("_ROOMS") ||
|
|
167
|
+
keyUpper.endsWith("_RELAYS") ||
|
|
168
|
+
keyUpper.endsWith("_FEEDS") ||
|
|
169
|
+
keyUpper.endsWith("_DEXES") ||
|
|
170
|
+
keyUpper.endsWith("_WHITELIST") ||
|
|
171
|
+
keyUpper.endsWith("_BLACKLIST") ||
|
|
172
|
+
keyUpper.endsWith("_ALLOWLIST") ||
|
|
173
|
+
keyUpper.endsWith("_SPACES") ||
|
|
174
|
+
keyUpper.endsWith("_THREADS") ||
|
|
175
|
+
keyUpper.endsWith("_ROLES") ||
|
|
176
|
+
keyUpper.endsWith("_TENANTS") ||
|
|
177
|
+
keyUpper.endsWith("_DIRS");
|
|
178
|
+
if (isCommaSep || isListSuffix) {
|
|
179
|
+
prop.type = "array";
|
|
180
|
+
prop.items = { type: "string" };
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// Auto-detect textarea (prompts, instructions, templates, greetings)
|
|
184
|
+
if (prop.type === "string" && !prop.enum && !keyUpper.includes("MODEL")) {
|
|
185
|
+
if (keyUpper.includes("INSTRUCTIONS") ||
|
|
186
|
+
keyUpper.includes("_GREETING") ||
|
|
187
|
+
keyUpper.endsWith("_PROMPT") ||
|
|
188
|
+
keyUpper.endsWith("_TEMPLATE") ||
|
|
189
|
+
keyUpper.includes("SYSTEM_MESSAGE")) {
|
|
190
|
+
prop.maxLength = 999;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// Auto-detect JSON fields (json-encoded or serialized values)
|
|
194
|
+
if (prop.type === "string" && !p.sensitive) {
|
|
195
|
+
const descLower = (p.description || "").toLowerCase();
|
|
196
|
+
if (descLower.includes("json-encoded") ||
|
|
197
|
+
descLower.includes("json array") ||
|
|
198
|
+
descLower.includes("serialized") ||
|
|
199
|
+
descLower.includes("json format")) {
|
|
200
|
+
prop.__jsonHint = true;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
// Auto-detect file/directory paths → file renderer
|
|
204
|
+
if (prop.type === "string") {
|
|
205
|
+
if ((keyUpper.endsWith("_PATH") && !keyUpper.includes("WEBHOOK")) ||
|
|
206
|
+
keyUpper.endsWith("_DIR") ||
|
|
207
|
+
keyUpper.endsWith("_DIRECTORY") ||
|
|
208
|
+
keyUpper.endsWith("_FOLDER") ||
|
|
209
|
+
keyUpper.endsWith("_FILE")) {
|
|
210
|
+
prop.__fileHint = true;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// Auto-detect textarea from long descriptions
|
|
214
|
+
if (p.description && p.description.length > 200) {
|
|
215
|
+
prop.maxLength = 999;
|
|
216
|
+
}
|
|
217
|
+
properties[p.key] = prop;
|
|
218
|
+
if (p.required)
|
|
219
|
+
required.push(p.key);
|
|
220
|
+
// Build UI hint
|
|
221
|
+
const hint = {
|
|
222
|
+
label: autoLabel(p.key, pluginId),
|
|
223
|
+
sensitive: p.sensitive ?? false,
|
|
224
|
+
advanced: isAdvancedParam(p),
|
|
225
|
+
};
|
|
226
|
+
// Port numbers — constrain range
|
|
227
|
+
if (keyUpper.includes("PORT")) {
|
|
228
|
+
hint.min = 1;
|
|
229
|
+
hint.max = 65535;
|
|
230
|
+
prop.minimum = 1;
|
|
231
|
+
prop.maximum = 65535;
|
|
232
|
+
}
|
|
233
|
+
// Timeout/interval — show unit
|
|
234
|
+
if (keyUpper.includes("TIMEOUT") ||
|
|
235
|
+
keyUpper.includes("INTERVAL") ||
|
|
236
|
+
keyUpper.includes("_MS")) {
|
|
237
|
+
hint.unit = "ms";
|
|
238
|
+
prop.minimum = 0;
|
|
239
|
+
hint.min = 0;
|
|
240
|
+
}
|
|
241
|
+
// Count/limit — non-negative
|
|
242
|
+
if (keyUpper.includes("COUNT") ||
|
|
243
|
+
keyUpper.includes("LIMIT") ||
|
|
244
|
+
keyUpper.startsWith("MAX_")) {
|
|
245
|
+
hint.min = 0;
|
|
246
|
+
prop.minimum = 0;
|
|
247
|
+
}
|
|
248
|
+
// Retry — bounded range
|
|
249
|
+
if (keyUpper.includes("RETRY") || keyUpper.includes("RETRIES")) {
|
|
250
|
+
hint.min = 0;
|
|
251
|
+
hint.max = 100;
|
|
252
|
+
prop.minimum = 0;
|
|
253
|
+
prop.maximum = 100;
|
|
254
|
+
}
|
|
255
|
+
// Debug/verbose/enabled — mark as advanced
|
|
256
|
+
if (keyUpper.includes("DEBUG") ||
|
|
257
|
+
keyUpper.includes("VERBOSE") ||
|
|
258
|
+
keyUpper.includes("ENABLED")) {
|
|
259
|
+
hint.advanced = true;
|
|
260
|
+
}
|
|
261
|
+
// Model selection — NOT advanced (important user-facing choice)
|
|
262
|
+
if (keyUpper.includes("MODEL") && p.options?.length) {
|
|
263
|
+
hint.advanced = false;
|
|
264
|
+
}
|
|
265
|
+
// Region/zone — suggest common cloud regions when no options provided
|
|
266
|
+
if ((keyUpper.includes("REGION") || keyUpper.includes("ZONE")) &&
|
|
267
|
+
!p.options?.length) {
|
|
268
|
+
hint.type = "select";
|
|
269
|
+
hint.options = [
|
|
270
|
+
{ value: "us-east-1", label: "US East (N. Virginia)" },
|
|
271
|
+
{ value: "us-west-2", label: "US West (Oregon)" },
|
|
272
|
+
{ value: "eu-west-1", label: "EU (Ireland)" },
|
|
273
|
+
{ value: "eu-central-1", label: "EU (Frankfurt)" },
|
|
274
|
+
{ value: "ap-southeast-1", label: "Asia Pacific (Singapore)" },
|
|
275
|
+
{ value: "ap-northeast-1", label: "Asia Pacific (Tokyo)" },
|
|
276
|
+
];
|
|
277
|
+
}
|
|
278
|
+
// File/directory path → file renderer
|
|
279
|
+
if (prop.__fileHint) {
|
|
280
|
+
hint.type = "file";
|
|
281
|
+
delete prop.__fileHint;
|
|
282
|
+
}
|
|
283
|
+
// JSON-encoded value → json renderer
|
|
284
|
+
if (prop.__jsonHint) {
|
|
285
|
+
hint.type = "json";
|
|
286
|
+
delete prop.__jsonHint;
|
|
287
|
+
}
|
|
288
|
+
// Model name fields — helpful placeholder (overridden by server-provided model options via configUiHints)
|
|
289
|
+
if (keyUpper.includes("MODEL") &&
|
|
290
|
+
prop.type === "string" &&
|
|
291
|
+
!p.options?.length) {
|
|
292
|
+
if (!hint.placeholder) {
|
|
293
|
+
if (keyUpper.includes("EMBEDDING")) {
|
|
294
|
+
hint.placeholder = "e.g., text-embedding-3-small";
|
|
295
|
+
}
|
|
296
|
+
else if (keyUpper.includes("TTS")) {
|
|
297
|
+
hint.placeholder = "e.g., tts-1, eleven_multilingual_v2";
|
|
298
|
+
}
|
|
299
|
+
else if (keyUpper.includes("STT")) {
|
|
300
|
+
hint.placeholder = "e.g., whisper-1";
|
|
301
|
+
}
|
|
302
|
+
else if (keyUpper.includes("IMAGE")) {
|
|
303
|
+
hint.placeholder = "e.g., dall-e-3, gpt-4o";
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
hint.placeholder = "e.g., gpt-4o, claude-sonnet-4-20250514";
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
// Mode/strategy fields — extract options from description if available
|
|
311
|
+
if (prop.type === "string" &&
|
|
312
|
+
!prop.enum &&
|
|
313
|
+
!p.sensitive &&
|
|
314
|
+
(keyUpper.endsWith("_MODE") || keyUpper.endsWith("_STRATEGY"))) {
|
|
315
|
+
const desc = p.description ?? "";
|
|
316
|
+
// Match "auto | local | mcp" or "filesystem|in-context|sqlite"
|
|
317
|
+
const pipeMatch = desc.match(/:\s*([a-z0-9_-]+(?:\s*[|/]\s*[a-z0-9_-]+)+)/i) ??
|
|
318
|
+
desc.match(/\(([a-z0-9_-]+(?:\s*[|/,]\s*[a-z0-9_-]+)+)\)/i);
|
|
319
|
+
if (pipeMatch) {
|
|
320
|
+
const opts = pipeMatch[1]
|
|
321
|
+
.split(/[|/,]/)
|
|
322
|
+
.map((s) => s.trim())
|
|
323
|
+
.filter(Boolean);
|
|
324
|
+
const safeOpts = opts.filter((v) => /^[a-z0-9_-]+$/i.test(v));
|
|
325
|
+
if (safeOpts.length >= 2 && safeOpts.length <= 10) {
|
|
326
|
+
hint.type = "select";
|
|
327
|
+
hint.options = safeOpts.map((v) => ({ value: v, label: v }));
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
// Match 'polling' or 'webhook' -or- 'env', 'oauth', or 'bearer' style
|
|
332
|
+
const quotedOpts = [...desc.matchAll(/'([a-z0-9_-]+)'/gi)].map((m) => m[1]);
|
|
333
|
+
const safeQuoted = quotedOpts.filter((v) => /^[a-z0-9_-]+$/i.test(v));
|
|
334
|
+
if (safeQuoted.length >= 2 && safeQuoted.length <= 10) {
|
|
335
|
+
// Radio for 2 options, select for 3+
|
|
336
|
+
hint.type = safeQuoted.length === 2 ? "radio" : "select";
|
|
337
|
+
hint.options = safeQuoted.map((v) => ({ value: v, label: v }));
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (p.description) {
|
|
342
|
+
hint.help = p.description;
|
|
343
|
+
if (p.default != null)
|
|
344
|
+
hint.help += ` (default: ${String(p.default)})`;
|
|
345
|
+
}
|
|
346
|
+
if (p.sensitive)
|
|
347
|
+
hint.placeholder = p.isSet ? "******** (already set)" : "Enter value...";
|
|
348
|
+
else if (p.default)
|
|
349
|
+
hint.placeholder = `Default: ${String(p.default)}`;
|
|
350
|
+
hints[p.key] = hint;
|
|
351
|
+
}
|
|
352
|
+
return {
|
|
353
|
+
schema: { type: "object", properties, required },
|
|
354
|
+
hints,
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
/* ── PluginConfigForm bridge ─────────────────────────────────────────── */
|
|
358
|
+
function PluginConfigForm({ plugin, pluginConfigs, onParamChange, }) {
|
|
359
|
+
const params = plugin.parameters ?? [];
|
|
360
|
+
const { schema, hints: autoHints } = useMemo(() => paramsToSchema(params, plugin.id), [params, plugin.id]);
|
|
361
|
+
// Merge server-provided configUiHints over auto-generated hints.
|
|
362
|
+
// Server hints take priority (override auto-generated ones).
|
|
363
|
+
const hints = useMemo(() => {
|
|
364
|
+
const serverHints = plugin.configUiHints;
|
|
365
|
+
if (!serverHints || Object.keys(serverHints).length === 0)
|
|
366
|
+
return autoHints;
|
|
367
|
+
const merged = { ...autoHints };
|
|
368
|
+
for (const [key, serverHint] of Object.entries(serverHints)) {
|
|
369
|
+
merged[key] = { ...merged[key], ...serverHint };
|
|
370
|
+
}
|
|
371
|
+
return merged;
|
|
372
|
+
}, [autoHints, plugin.configUiHints]);
|
|
373
|
+
// Build values from current config state + existing server values.
|
|
374
|
+
// Array-typed fields need comma-separated strings parsed into arrays.
|
|
375
|
+
const values = useMemo(() => {
|
|
376
|
+
const v = {};
|
|
377
|
+
const props = (schema.properties ?? {});
|
|
378
|
+
for (const p of params) {
|
|
379
|
+
const isArrayField = props[p.key]?.type === "array";
|
|
380
|
+
const configValue = pluginConfigs[plugin.id]?.[p.key];
|
|
381
|
+
if (configValue !== undefined) {
|
|
382
|
+
if (isArrayField && typeof configValue === "string") {
|
|
383
|
+
v[p.key] = configValue
|
|
384
|
+
? configValue
|
|
385
|
+
.split(",")
|
|
386
|
+
.map((s) => s.trim())
|
|
387
|
+
.filter(Boolean)
|
|
388
|
+
: [];
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
v[p.key] = configValue;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
else if (p.isSet && !p.sensitive && p.currentValue != null) {
|
|
395
|
+
if (isArrayField && typeof p.currentValue === "string") {
|
|
396
|
+
v[p.key] = String(p.currentValue)
|
|
397
|
+
? String(p.currentValue)
|
|
398
|
+
.split(",")
|
|
399
|
+
.map((s) => s.trim())
|
|
400
|
+
.filter(Boolean)
|
|
401
|
+
: [];
|
|
402
|
+
}
|
|
403
|
+
else {
|
|
404
|
+
v[p.key] = p.currentValue;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
return v;
|
|
409
|
+
}, [params, plugin.id, pluginConfigs, schema]);
|
|
410
|
+
const setKeys = useMemo(() => new Set(params
|
|
411
|
+
.filter((p) => p.isSet)
|
|
412
|
+
.map((p) => p.key)), [params]);
|
|
413
|
+
const handleChange = useCallback((key, value) => {
|
|
414
|
+
// Join array values back to comma-separated strings for env var storage
|
|
415
|
+
const stringValue = Array.isArray(value)
|
|
416
|
+
? value.join(", ")
|
|
417
|
+
: String(value ?? "");
|
|
418
|
+
onParamChange(plugin.id, key, stringValue);
|
|
419
|
+
}, [plugin.id, onParamChange]);
|
|
420
|
+
return (_jsx(ConfigRenderer, { schema: schema, hints: hints, values: values, setKeys: setKeys, registry: defaultRegistry, pluginId: plugin.id, onChange: handleChange }));
|
|
421
|
+
}
|
|
422
|
+
/* ── Default Icons ─────────────────────────────────────────────────── */
|
|
423
|
+
const DEFAULT_ICONS = {
|
|
424
|
+
// AI Providers
|
|
425
|
+
anthropic: Brain,
|
|
426
|
+
"google-genai": Sparkles,
|
|
427
|
+
groq: Zap,
|
|
428
|
+
"local-ai": Monitor,
|
|
429
|
+
ollama: Bot,
|
|
430
|
+
openai: CircleDashed,
|
|
431
|
+
openrouter: Shuffle,
|
|
432
|
+
"vercel-ai-gateway": Triangle,
|
|
433
|
+
xai: Hash,
|
|
434
|
+
// Connectors — chat & social
|
|
435
|
+
discord: MessageCircle,
|
|
436
|
+
telegram: Send,
|
|
437
|
+
slack: Briefcase,
|
|
438
|
+
twitter: Twitter,
|
|
439
|
+
whatsapp: Smartphone,
|
|
440
|
+
signal: Lock,
|
|
441
|
+
imessage: MessageSquare,
|
|
442
|
+
bluebubbles: Droplets,
|
|
443
|
+
bluesky: Leaf,
|
|
444
|
+
farcaster: Circle,
|
|
445
|
+
instagram: Video,
|
|
446
|
+
nostr: Fingerprint,
|
|
447
|
+
twitch: Gamepad2,
|
|
448
|
+
matrix: Link,
|
|
449
|
+
mattermost: Diamond,
|
|
450
|
+
msteams: Square,
|
|
451
|
+
"google-chat": MessagesSquare,
|
|
452
|
+
feishu: Feather,
|
|
453
|
+
line: Circle,
|
|
454
|
+
"nextcloud-talk": Cloud,
|
|
455
|
+
tlon: Tornado,
|
|
456
|
+
zalo: Circle,
|
|
457
|
+
zalouser: Circle,
|
|
458
|
+
// Features — voice & audio
|
|
459
|
+
"edge-tts": Volume2,
|
|
460
|
+
elevenlabs: Mic,
|
|
461
|
+
tts: Volume2,
|
|
462
|
+
"simple-voice": Mic,
|
|
463
|
+
"robot-voice": Bot,
|
|
464
|
+
// Features — blockchain & finance
|
|
465
|
+
evm: Link,
|
|
466
|
+
solana: CircleDot,
|
|
467
|
+
"auto-trader": TrendingDown,
|
|
468
|
+
"lp-manager": Wallet,
|
|
469
|
+
"social-alpha": Layers,
|
|
470
|
+
polymarket: Gamepad2,
|
|
471
|
+
x402: CreditCard,
|
|
472
|
+
trust: Handshake,
|
|
473
|
+
iq: Puzzle,
|
|
474
|
+
// Features — dev tools & infra
|
|
475
|
+
cli: Hash,
|
|
476
|
+
code: Puzzle,
|
|
477
|
+
shell: Shell,
|
|
478
|
+
github: Github,
|
|
479
|
+
linear: Square,
|
|
480
|
+
mcp: Puzzle,
|
|
481
|
+
browser: Chrome,
|
|
482
|
+
computeruse: MousePointer2,
|
|
483
|
+
n8n: Settings,
|
|
484
|
+
webhooks: Webhook,
|
|
485
|
+
// Features — knowledge & memory
|
|
486
|
+
knowledge: BookOpen,
|
|
487
|
+
memory: Dna,
|
|
488
|
+
"local-embedding": Binary,
|
|
489
|
+
pdf: FileText,
|
|
490
|
+
"secrets-manager": FileKey,
|
|
491
|
+
scratchpad: StickyNote,
|
|
492
|
+
rlm: RefreshCw,
|
|
493
|
+
// Features — agents & orchestration
|
|
494
|
+
"agent-orchestrator": Target,
|
|
495
|
+
"agent-skills": Wrench,
|
|
496
|
+
"plugin-manager": Package,
|
|
497
|
+
"copilot-proxy": Handshake,
|
|
498
|
+
directives: ClipboardList,
|
|
499
|
+
goals: Target,
|
|
500
|
+
"eliza-classic": Bot,
|
|
501
|
+
// Features — media & content
|
|
502
|
+
vision: Eye,
|
|
503
|
+
rss: Rss,
|
|
504
|
+
"gmail-watch": Mail,
|
|
505
|
+
prose: PenTool,
|
|
506
|
+
form: ClipboardList,
|
|
507
|
+
// Features — scheduling & automation
|
|
508
|
+
cron: Clock,
|
|
509
|
+
scheduling: Calendar,
|
|
510
|
+
todo: ClipboardList,
|
|
511
|
+
commands: Command,
|
|
512
|
+
// Features — storage & logging
|
|
513
|
+
"s3-storage": Server,
|
|
514
|
+
"trajectory-logger": TrendingDown,
|
|
515
|
+
experience: Star,
|
|
516
|
+
// Features — gaming & misc
|
|
517
|
+
minecraft: Pickaxe,
|
|
518
|
+
roblox: BrickWall,
|
|
519
|
+
babylon: Gamepad,
|
|
520
|
+
mysticism: Sparkle,
|
|
521
|
+
personality: Target,
|
|
522
|
+
moltbook: ScrollText,
|
|
523
|
+
tee: LockKeyhole,
|
|
524
|
+
blooio: Circle,
|
|
525
|
+
acp: Construction,
|
|
526
|
+
elizacloud: Cloud,
|
|
527
|
+
twilio: Phone,
|
|
528
|
+
};
|
|
529
|
+
/** Resolve display icon: explicit plugin.icon, fallback to default map, or null. */
|
|
530
|
+
function resolveIcon(p) {
|
|
531
|
+
if (p.icon)
|
|
532
|
+
return p.icon;
|
|
533
|
+
return DEFAULT_ICONS[p.id] ?? null;
|
|
534
|
+
}
|
|
535
|
+
function iconImageSource(icon) {
|
|
536
|
+
const value = icon.trim();
|
|
537
|
+
if (!value)
|
|
538
|
+
return null;
|
|
539
|
+
if (/^(https?:|data:image\/|blob:|file:|capacitor:|capacitor-electron:|app:|\/|\.\/|\.\.\/)/i.test(value)) {
|
|
540
|
+
return resolveAppAssetUrl(value);
|
|
541
|
+
}
|
|
542
|
+
return null;
|
|
543
|
+
}
|
|
544
|
+
function getPluginResourceLinks(plugin) {
|
|
545
|
+
const seen = new Set();
|
|
546
|
+
const ordered = [
|
|
547
|
+
{ key: "guide", label: "Setup guide", url: plugin.setupGuideUrl },
|
|
548
|
+
{ key: "official", label: "Official", url: plugin.homepage },
|
|
549
|
+
{ key: "source", label: "Source", url: plugin.repository },
|
|
550
|
+
];
|
|
551
|
+
return ordered.flatMap((item) => {
|
|
552
|
+
const url = item.url?.trim();
|
|
553
|
+
if (!url || seen.has(url))
|
|
554
|
+
return [];
|
|
555
|
+
seen.add(url);
|
|
556
|
+
return [{ key: item.key, label: item.label, url }];
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
/* ── Sub-group Classification ──────────────────────────────────────── */
|
|
560
|
+
/** Map plugin IDs to fine-grained sub-groups for the "Feature" category. */
|
|
561
|
+
const FEATURE_SUBGROUP = {
|
|
562
|
+
// Voice & Audio
|
|
563
|
+
"edge-tts": "voice",
|
|
564
|
+
elevenlabs: "voice",
|
|
565
|
+
tts: "voice",
|
|
566
|
+
"simple-voice": "voice",
|
|
567
|
+
"robot-voice": "voice",
|
|
568
|
+
// Blockchain & Finance
|
|
569
|
+
evm: "blockchain",
|
|
570
|
+
solana: "blockchain",
|
|
571
|
+
"auto-trader": "blockchain",
|
|
572
|
+
"lp-manager": "blockchain",
|
|
573
|
+
"social-alpha": "blockchain",
|
|
574
|
+
polymarket: "blockchain",
|
|
575
|
+
x402: "blockchain",
|
|
576
|
+
trust: "blockchain",
|
|
577
|
+
iq: "blockchain",
|
|
578
|
+
// Dev Tools & Infrastructure
|
|
579
|
+
cli: "devtools",
|
|
580
|
+
code: "devtools",
|
|
581
|
+
shell: "devtools",
|
|
582
|
+
github: "devtools",
|
|
583
|
+
linear: "devtools",
|
|
584
|
+
mcp: "devtools",
|
|
585
|
+
browser: "devtools",
|
|
586
|
+
computeruse: "devtools",
|
|
587
|
+
n8n: "devtools",
|
|
588
|
+
webhooks: "devtools",
|
|
589
|
+
// Knowledge & Memory
|
|
590
|
+
knowledge: "knowledge",
|
|
591
|
+
memory: "knowledge",
|
|
592
|
+
"local-embedding": "knowledge",
|
|
593
|
+
pdf: "knowledge",
|
|
594
|
+
"secrets-manager": "knowledge",
|
|
595
|
+
scratchpad: "knowledge",
|
|
596
|
+
rlm: "knowledge",
|
|
597
|
+
// Agents & Orchestration
|
|
598
|
+
"agent-orchestrator": "agents",
|
|
599
|
+
"agent-skills": "agents",
|
|
600
|
+
"plugin-manager": "agents",
|
|
601
|
+
"copilot-proxy": "agents",
|
|
602
|
+
directives: "agents",
|
|
603
|
+
goals: "agents",
|
|
604
|
+
"eliza-classic": "agents",
|
|
605
|
+
// Media & Content
|
|
606
|
+
vision: "media",
|
|
607
|
+
rss: "media",
|
|
608
|
+
"gmail-watch": "media",
|
|
609
|
+
prose: "media",
|
|
610
|
+
form: "media",
|
|
611
|
+
// Scheduling & Automation
|
|
612
|
+
cron: "automation",
|
|
613
|
+
scheduling: "automation",
|
|
614
|
+
todo: "automation",
|
|
615
|
+
commands: "automation",
|
|
616
|
+
// Storage & Logging
|
|
617
|
+
"s3-storage": "storage",
|
|
618
|
+
"trajectory-logger": "storage",
|
|
619
|
+
experience: "storage",
|
|
620
|
+
// Gaming & Creative
|
|
621
|
+
minecraft: "gaming",
|
|
622
|
+
roblox: "gaming",
|
|
623
|
+
babylon: "gaming",
|
|
624
|
+
mysticism: "gaming",
|
|
625
|
+
personality: "gaming",
|
|
626
|
+
moltbook: "gaming",
|
|
627
|
+
};
|
|
628
|
+
const SUBGROUP_DISPLAY_ORDER = [
|
|
629
|
+
"ai-provider",
|
|
630
|
+
"connector",
|
|
631
|
+
"streaming",
|
|
632
|
+
"voice",
|
|
633
|
+
"blockchain",
|
|
634
|
+
"devtools",
|
|
635
|
+
"knowledge",
|
|
636
|
+
"agents",
|
|
637
|
+
"media",
|
|
638
|
+
"automation",
|
|
639
|
+
"storage",
|
|
640
|
+
"gaming",
|
|
641
|
+
"feature-other",
|
|
642
|
+
"showcase",
|
|
643
|
+
];
|
|
644
|
+
const SUBGROUP_LABELS = {
|
|
645
|
+
"ai-provider": "AI Providers",
|
|
646
|
+
connector: "Connectors",
|
|
647
|
+
voice: "Voice & Audio",
|
|
648
|
+
blockchain: "Blockchain & Finance",
|
|
649
|
+
devtools: "Dev Tools & Infrastructure",
|
|
650
|
+
knowledge: "Knowledge & Memory",
|
|
651
|
+
agents: "Agents & Orchestration",
|
|
652
|
+
media: "Media & Content",
|
|
653
|
+
automation: "Scheduling & Automation",
|
|
654
|
+
storage: "Storage & Logging",
|
|
655
|
+
gaming: "Gaming & Creative",
|
|
656
|
+
"feature-other": "Other Features",
|
|
657
|
+
streaming: "Streaming Destinations",
|
|
658
|
+
showcase: "Showcase",
|
|
659
|
+
};
|
|
660
|
+
const SUBGROUP_NAV_ICONS = {
|
|
661
|
+
all: Package,
|
|
662
|
+
"ai-provider": Brain,
|
|
663
|
+
connector: MessageCircle,
|
|
664
|
+
streaming: Video,
|
|
665
|
+
voice: Mic,
|
|
666
|
+
blockchain: Wallet,
|
|
667
|
+
devtools: Shell,
|
|
668
|
+
knowledge: BookOpen,
|
|
669
|
+
agents: Target,
|
|
670
|
+
media: Eye,
|
|
671
|
+
automation: Calendar,
|
|
672
|
+
storage: Server,
|
|
673
|
+
gaming: Gamepad2,
|
|
674
|
+
"feature-other": Puzzle,
|
|
675
|
+
showcase: Sparkles,
|
|
676
|
+
};
|
|
677
|
+
function subgroupForPlugin(plugin) {
|
|
678
|
+
if (plugin.id === "__ui-showcase__")
|
|
679
|
+
return "showcase";
|
|
680
|
+
if (plugin.category === "ai-provider")
|
|
681
|
+
return "ai-provider";
|
|
682
|
+
if (plugin.category === "connector")
|
|
683
|
+
return "connector";
|
|
684
|
+
if (plugin.category === "streaming")
|
|
685
|
+
return "streaming";
|
|
686
|
+
return FEATURE_SUBGROUP[plugin.id] ?? "feature-other";
|
|
687
|
+
}
|
|
688
|
+
function comparePlugins(left, right) {
|
|
689
|
+
if (left.enabled !== right.enabled)
|
|
690
|
+
return left.enabled ? -1 : 1;
|
|
691
|
+
if (left.enabled && right.enabled) {
|
|
692
|
+
const leftNeedsConfig = left.parameters?.some((param) => param.required && !param.isSet) ?? false;
|
|
693
|
+
const rightNeedsConfig = right.parameters?.some((param) => param.required && !param.isSet) ?? false;
|
|
694
|
+
if (leftNeedsConfig !== rightNeedsConfig) {
|
|
695
|
+
return leftNeedsConfig ? -1 : 1;
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
return (left.name ?? "").localeCompare(right.name ?? "");
|
|
699
|
+
}
|
|
700
|
+
function matchesPluginFilters(plugin, searchLower, statusFilter) {
|
|
701
|
+
const matchesStatus = statusFilter === "all" ||
|
|
702
|
+
(statusFilter === "enabled" && plugin.enabled) ||
|
|
703
|
+
(statusFilter === "disabled" && !plugin.enabled);
|
|
704
|
+
const matchesSearch = !searchLower ||
|
|
705
|
+
(plugin.name ?? "").toLowerCase().includes(searchLower) ||
|
|
706
|
+
(plugin.description ?? "").toLowerCase().includes(searchLower) ||
|
|
707
|
+
(plugin.tags ?? []).some((tag) => (tag ?? "").toLowerCase().includes(searchLower)) ||
|
|
708
|
+
plugin.id.toLowerCase().includes(searchLower);
|
|
709
|
+
return matchesStatus && matchesSearch;
|
|
710
|
+
}
|
|
711
|
+
function sortPlugins(filteredPlugins, pluginOrder, allowCustomOrder) {
|
|
712
|
+
if (!allowCustomOrder || pluginOrder.length === 0) {
|
|
713
|
+
return [...filteredPlugins].sort(comparePlugins);
|
|
714
|
+
}
|
|
715
|
+
const orderMap = new Map(pluginOrder.map((id, index) => [id, index]));
|
|
716
|
+
return [...filteredPlugins].sort((left, right) => {
|
|
717
|
+
const leftIndex = orderMap.get(left.id);
|
|
718
|
+
const rightIndex = orderMap.get(right.id);
|
|
719
|
+
if (leftIndex != null && rightIndex != null)
|
|
720
|
+
return leftIndex - rightIndex;
|
|
721
|
+
if (leftIndex != null)
|
|
722
|
+
return -1;
|
|
723
|
+
if (rightIndex != null)
|
|
724
|
+
return 1;
|
|
725
|
+
return comparePlugins(left, right);
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
function buildPluginListState(options) {
|
|
729
|
+
const { allowCustomOrder, effectiveSearch, effectiveStatusFilter, isConnectorLikeMode, mode, pluginOrder, plugins, showSubgroupFilters, subgroupFilter, } = options;
|
|
730
|
+
const categoryPlugins = plugins.filter((plugin) => plugin.category !== "database" &&
|
|
731
|
+
!ALWAYS_ON_PLUGIN_IDS.has(plugin.id) &&
|
|
732
|
+
(!isConnectorLikeMode || plugin.category === "connector") &&
|
|
733
|
+
(mode !== "streaming" || plugin.category === "streaming"));
|
|
734
|
+
const nonDbPlugins = [SHOWCASE_PLUGIN, ...categoryPlugins];
|
|
735
|
+
const searchLower = effectiveSearch.toLowerCase();
|
|
736
|
+
const sorted = sortPlugins(categoryPlugins.filter((plugin) => matchesPluginFilters(plugin, searchLower, effectiveStatusFilter)), pluginOrder, allowCustomOrder);
|
|
737
|
+
const enabledCount = categoryPlugins.filter((plugin) => plugin.enabled).length;
|
|
738
|
+
const subgroupCounts = {};
|
|
739
|
+
const visiblePlugins = [];
|
|
740
|
+
for (const plugin of sorted) {
|
|
741
|
+
const subgroup = subgroupForPlugin(plugin);
|
|
742
|
+
subgroupCounts[subgroup] = (subgroupCounts[subgroup] ?? 0) + 1;
|
|
743
|
+
if (!showSubgroupFilters ||
|
|
744
|
+
subgroupFilter === "all" ||
|
|
745
|
+
subgroup === subgroupFilter) {
|
|
746
|
+
visiblePlugins.push(plugin);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
const subgroupTags = [
|
|
750
|
+
{ id: "all", label: "All", count: sorted.length },
|
|
751
|
+
...SUBGROUP_DISPLAY_ORDER.filter((subgroupId) => (subgroupCounts[subgroupId] ?? 0) > 0).map((subgroupId) => ({
|
|
752
|
+
id: subgroupId,
|
|
753
|
+
label: SUBGROUP_LABELS[subgroupId],
|
|
754
|
+
count: subgroupCounts[subgroupId] ?? 0,
|
|
755
|
+
})),
|
|
756
|
+
];
|
|
757
|
+
return {
|
|
758
|
+
categoryPlugins,
|
|
759
|
+
enabledCount,
|
|
760
|
+
nonDbPlugins,
|
|
761
|
+
sorted,
|
|
762
|
+
subgroupTags,
|
|
763
|
+
visiblePlugins,
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
function PluginListView({ label, mode = "all", inModal }) {
|
|
767
|
+
const { plugins, pluginStatusFilter, pluginSearch, pluginSettingsOpen, pluginSaving, pluginSaveSuccess, loadPlugins, handlePluginToggle, handlePluginConfigSave, setActionNotice, setState, t, } = useApp();
|
|
768
|
+
const [pluginConfigs, setPluginConfigs] = useState({});
|
|
769
|
+
const [testResults, setTestResults] = useState(new Map());
|
|
770
|
+
const [addDirOpen, setAddDirOpen] = useState(false);
|
|
771
|
+
const [addDirPath, setAddDirPath] = useState("");
|
|
772
|
+
const [addDirLoading, setAddDirLoading] = useState(false);
|
|
773
|
+
const [installingPlugins, setInstallingPlugins] = useState(new Set());
|
|
774
|
+
const [installProgress, setInstallProgress] = useState(new Map());
|
|
775
|
+
const [togglingPlugins, setTogglingPlugins] = useState(new Set());
|
|
776
|
+
const hasPluginToggleInFlight = togglingPlugins.size > 0;
|
|
777
|
+
// ── Drag-to-reorder state ────────────────────────────────────────
|
|
778
|
+
const [pluginOrder, setPluginOrder] = useState(() => {
|
|
779
|
+
try {
|
|
780
|
+
const stored = localStorage.getItem("pluginOrder");
|
|
781
|
+
return stored ? JSON.parse(stored) : [];
|
|
782
|
+
}
|
|
783
|
+
catch {
|
|
784
|
+
return [];
|
|
785
|
+
}
|
|
786
|
+
});
|
|
787
|
+
const [draggingId, setDraggingId] = useState(null);
|
|
788
|
+
const [dragOverId, setDragOverId] = useState(null);
|
|
789
|
+
const dragRef = useRef(null);
|
|
790
|
+
const isSocialMode = mode === "social";
|
|
791
|
+
const isConnectorLikeMode = mode === "connectors" || mode === "social";
|
|
792
|
+
const resultLabel = isSocialMode ? "connectors" : label.toLowerCase();
|
|
793
|
+
const searchPlaceholder = isSocialMode
|
|
794
|
+
? "Search..."
|
|
795
|
+
: `Search ${label.toLowerCase()}...`;
|
|
796
|
+
const effectiveStatusFilter = isSocialMode && pluginStatusFilter === "disabled"
|
|
797
|
+
? "all"
|
|
798
|
+
: pluginStatusFilter;
|
|
799
|
+
const effectiveSearch = pluginSearch;
|
|
800
|
+
const showToolbar = true;
|
|
801
|
+
const allowCustomOrder = !isSocialMode;
|
|
802
|
+
const showPluginManagementActions = !isSocialMode;
|
|
803
|
+
// Load plugins on mount
|
|
804
|
+
useEffect(() => {
|
|
805
|
+
void loadPlugins();
|
|
806
|
+
}, [loadPlugins]);
|
|
807
|
+
// Listen for install progress events via WebSocket
|
|
808
|
+
useEffect(() => {
|
|
809
|
+
const unbind = client.onWsEvent("install-progress", (data) => {
|
|
810
|
+
const pluginName = data.pluginName;
|
|
811
|
+
const phase = data.phase;
|
|
812
|
+
const message = data.message;
|
|
813
|
+
if (!pluginName)
|
|
814
|
+
return;
|
|
815
|
+
if (phase === "complete" || phase === "error") {
|
|
816
|
+
setInstallProgress((prev) => {
|
|
817
|
+
const next = new Map(prev);
|
|
818
|
+
next.delete(pluginName);
|
|
819
|
+
return next;
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
else {
|
|
823
|
+
setInstallProgress((prev) => new Map(prev).set(pluginName, { phase, message }));
|
|
824
|
+
}
|
|
825
|
+
});
|
|
826
|
+
return unbind;
|
|
827
|
+
}, []);
|
|
828
|
+
// Persist custom order
|
|
829
|
+
useEffect(() => {
|
|
830
|
+
if (pluginOrder.length > 0) {
|
|
831
|
+
localStorage.setItem("pluginOrder", JSON.stringify(pluginOrder));
|
|
832
|
+
}
|
|
833
|
+
}, [pluginOrder]);
|
|
834
|
+
const [subgroupFilter, setSubgroupFilter] = useState("all");
|
|
835
|
+
const showSubgroupFilters = mode !== "connectors" && mode !== "streaming" && mode !== "social";
|
|
836
|
+
const showDesktopSubgroupSidebar = showSubgroupFilters;
|
|
837
|
+
const { categoryPlugins, enabledCount, nonDbPlugins, sorted, subgroupTags, visiblePlugins, } = useMemo(() => buildPluginListState({
|
|
838
|
+
allowCustomOrder,
|
|
839
|
+
effectiveSearch,
|
|
840
|
+
effectiveStatusFilter,
|
|
841
|
+
isConnectorLikeMode,
|
|
842
|
+
mode,
|
|
843
|
+
pluginOrder,
|
|
844
|
+
plugins,
|
|
845
|
+
showSubgroupFilters,
|
|
846
|
+
subgroupFilter,
|
|
847
|
+
}), [
|
|
848
|
+
allowCustomOrder,
|
|
849
|
+
effectiveSearch,
|
|
850
|
+
effectiveStatusFilter,
|
|
851
|
+
isConnectorLikeMode,
|
|
852
|
+
mode,
|
|
853
|
+
pluginOrder,
|
|
854
|
+
plugins,
|
|
855
|
+
showSubgroupFilters,
|
|
856
|
+
subgroupFilter,
|
|
857
|
+
]);
|
|
858
|
+
useEffect(() => {
|
|
859
|
+
if (!showSubgroupFilters)
|
|
860
|
+
return;
|
|
861
|
+
if (subgroupFilter === "all")
|
|
862
|
+
return;
|
|
863
|
+
if (!subgroupTags.some((tag) => tag.id === subgroupFilter)) {
|
|
864
|
+
setSubgroupFilter("all");
|
|
865
|
+
}
|
|
866
|
+
}, [showSubgroupFilters, subgroupFilter, subgroupTags]);
|
|
867
|
+
const renderSubgroupFilterButton = useCallback((tag, options) => {
|
|
868
|
+
const isActive = subgroupFilter === tag.id;
|
|
869
|
+
if (options?.sidebar) {
|
|
870
|
+
const Icon = SUBGROUP_NAV_ICONS[tag.id] ?? Package;
|
|
871
|
+
return (_jsxs("button", { type: "button", onClick: () => setSubgroupFilter(tag.id), "aria-current": isActive ? "page" : undefined, className: `flex w-full items-center gap-3 rounded-2xl border px-4 py-3 text-left transition-all duration-200 ${isActive
|
|
872
|
+
? "border-accent/40 bg-accent/12 text-txt shadow-[0_10px_30px_rgba(var(--accent),0.08)]"
|
|
873
|
+
: "border-transparent text-muted hover:border-border/60 hover:bg-card/55 hover:text-txt"}`, children: [_jsx("span", { className: `flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border ${isActive
|
|
874
|
+
? "border-accent/30 bg-accent/18 text-txt-strong"
|
|
875
|
+
: "border-border/50 bg-bg-accent/80 text-muted"}`, children: _jsx(Icon, { className: "w-4 h-4" }) }), _jsx("span", { className: "min-w-0 flex-1", children: _jsx("span", { className: "block text-sm font-semibold leading-snug text-current", children: tag.label }) }), _jsx("span", { className: `rounded-full border px-2 py-0.5 text-[10px] font-mono leading-none ${isActive
|
|
876
|
+
? "border-accent/20 bg-accent/20 text-txt"
|
|
877
|
+
: "border-border/50 bg-black/10 text-muted"}`, children: tag.count })] }, tag.id));
|
|
878
|
+
}
|
|
879
|
+
return (_jsxs(Button, { variant: isActive ? "default" : "outline", size: "sm", className: `h-7 px-3 text-[11px] font-bold tracking-wide rounded-lg transition-all ${isActive
|
|
880
|
+
? "shadow-[0_0_10px_rgba(var(--accent),0.2)] border-accent"
|
|
881
|
+
: "bg-card/40 backdrop-blur-sm border-border/40 text-muted hover:text-txt shadow-sm hover:border-accent/30"}`, onClick: () => setSubgroupFilter(tag.id), children: [tag.label, _jsx("span", { className: `ml-1.5 px-1.5 py-0.5 rounded border text-[9px] font-mono leading-none ${isActive ? "bg-black/20 border-black/10" : "bg-black/10 border-white/5"}`, children: tag.count })] }, tag.id));
|
|
882
|
+
}, [subgroupFilter]);
|
|
883
|
+
// ── Handlers ───────────────────────────────────────────────────────
|
|
884
|
+
const toggleSettings = (pluginId) => {
|
|
885
|
+
const next = new Set();
|
|
886
|
+
if (!pluginSettingsOpen.has(pluginId))
|
|
887
|
+
next.add(pluginId);
|
|
888
|
+
setState("pluginSettingsOpen", next);
|
|
889
|
+
};
|
|
890
|
+
const handleParamChange = (pluginId, paramKey, value) => {
|
|
891
|
+
setPluginConfigs((prev) => ({
|
|
892
|
+
...prev,
|
|
893
|
+
[pluginId]: { ...prev[pluginId], [paramKey]: value },
|
|
894
|
+
}));
|
|
895
|
+
};
|
|
896
|
+
const handleConfigSave = async (pluginId) => {
|
|
897
|
+
// Showcase plugin: no-op save (it's not a real plugin)
|
|
898
|
+
if (pluginId === "__ui-showcase__")
|
|
899
|
+
return;
|
|
900
|
+
const config = pluginConfigs[pluginId] ?? {};
|
|
901
|
+
await handlePluginConfigSave(pluginId, config);
|
|
902
|
+
setPluginConfigs((prev) => {
|
|
903
|
+
const next = { ...prev };
|
|
904
|
+
delete next[pluginId];
|
|
905
|
+
return next;
|
|
906
|
+
});
|
|
907
|
+
};
|
|
908
|
+
const handleConfigReset = (pluginId) => {
|
|
909
|
+
setPluginConfigs((prev) => {
|
|
910
|
+
const next = { ...prev };
|
|
911
|
+
delete next[pluginId];
|
|
912
|
+
return next;
|
|
913
|
+
});
|
|
914
|
+
};
|
|
915
|
+
const handleTestConnection = async (pluginId) => {
|
|
916
|
+
setTestResults((prev) => {
|
|
917
|
+
const next = new Map(prev);
|
|
918
|
+
next.set(pluginId, { success: false, loading: true, durationMs: 0 });
|
|
919
|
+
return next;
|
|
920
|
+
});
|
|
921
|
+
try {
|
|
922
|
+
const result = await client.testPluginConnection(pluginId);
|
|
923
|
+
setTestResults((prev) => {
|
|
924
|
+
const next = new Map(prev);
|
|
925
|
+
next.set(pluginId, { ...result, loading: false });
|
|
926
|
+
return next;
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
catch (err) {
|
|
930
|
+
setTestResults((prev) => {
|
|
931
|
+
const next = new Map(prev);
|
|
932
|
+
next.set(pluginId, {
|
|
933
|
+
success: false,
|
|
934
|
+
error: err instanceof Error ? err.message : String(err),
|
|
935
|
+
loading: false,
|
|
936
|
+
durationMs: 0,
|
|
937
|
+
});
|
|
938
|
+
return next;
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
};
|
|
942
|
+
const handleInstallPlugin = async (pluginId, npmName) => {
|
|
943
|
+
setInstallingPlugins((prev) => new Set(prev).add(pluginId));
|
|
944
|
+
try {
|
|
945
|
+
await client.installRegistryPlugin(npmName);
|
|
946
|
+
await loadPlugins();
|
|
947
|
+
setActionNotice(`${npmName} installed. Restart required to activate.`, "success");
|
|
948
|
+
}
|
|
949
|
+
catch (err) {
|
|
950
|
+
setActionNotice(`Failed to install ${npmName}: ${err instanceof Error ? err.message : "unknown error"}`, "error", 3800);
|
|
951
|
+
// Still try to refresh in case install succeeded but restart failed
|
|
952
|
+
try {
|
|
953
|
+
await loadPlugins();
|
|
954
|
+
}
|
|
955
|
+
catch {
|
|
956
|
+
/* ignore */
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
finally {
|
|
960
|
+
setInstallingPlugins((prev) => {
|
|
961
|
+
const next = new Set(prev);
|
|
962
|
+
next.delete(pluginId);
|
|
963
|
+
return next;
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
const handleTogglePlugin = useCallback(async (pluginId, enabled) => {
|
|
968
|
+
let shouldStart = false;
|
|
969
|
+
setTogglingPlugins((prev) => {
|
|
970
|
+
if (prev.has(pluginId) || prev.size > 0)
|
|
971
|
+
return prev;
|
|
972
|
+
shouldStart = true;
|
|
973
|
+
return new Set(prev).add(pluginId);
|
|
974
|
+
});
|
|
975
|
+
if (!shouldStart)
|
|
976
|
+
return;
|
|
977
|
+
try {
|
|
978
|
+
await handlePluginToggle(pluginId, enabled);
|
|
979
|
+
}
|
|
980
|
+
finally {
|
|
981
|
+
setTogglingPlugins((prev) => {
|
|
982
|
+
const next = new Set(prev);
|
|
983
|
+
next.delete(pluginId);
|
|
984
|
+
return next;
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
}, [handlePluginToggle]);
|
|
988
|
+
const handleOpenPluginExternalUrl = useCallback(async (url) => {
|
|
989
|
+
try {
|
|
990
|
+
await openExternalUrl(url);
|
|
991
|
+
}
|
|
992
|
+
catch (err) {
|
|
993
|
+
setActionNotice(err instanceof Error ? err.message : "Failed to open external link.", "error", 4200);
|
|
994
|
+
}
|
|
995
|
+
}, [setActionNotice]);
|
|
996
|
+
// ── Add from directory ──────────────────────────────────────────────
|
|
997
|
+
const handleAddFromDirectory = async () => {
|
|
998
|
+
const trimmed = addDirPath.trim();
|
|
999
|
+
if (!trimmed)
|
|
1000
|
+
return;
|
|
1001
|
+
setAddDirLoading(true);
|
|
1002
|
+
try {
|
|
1003
|
+
await client.installRegistryPlugin(trimmed);
|
|
1004
|
+
await loadPlugins();
|
|
1005
|
+
setAddDirPath("");
|
|
1006
|
+
setAddDirOpen(false);
|
|
1007
|
+
setActionNotice(`Plugin installed from ${trimmed}`, "success");
|
|
1008
|
+
}
|
|
1009
|
+
catch (err) {
|
|
1010
|
+
setActionNotice(`Failed to add plugin: ${err instanceof Error ? err.message : "unknown error"}`, "error", 3800);
|
|
1011
|
+
}
|
|
1012
|
+
setAddDirLoading(false);
|
|
1013
|
+
};
|
|
1014
|
+
// ── Drag-to-reorder handlers ─────────────────────────────────────
|
|
1015
|
+
const handleDragStart = useCallback((e, pluginId) => {
|
|
1016
|
+
dragRef.current = pluginId;
|
|
1017
|
+
setDraggingId(pluginId);
|
|
1018
|
+
e.dataTransfer.effectAllowed = "move";
|
|
1019
|
+
e.dataTransfer.setData("text/plain", pluginId);
|
|
1020
|
+
}, []);
|
|
1021
|
+
const handleDragOver = useCallback((e, pluginId) => {
|
|
1022
|
+
e.preventDefault();
|
|
1023
|
+
e.dataTransfer.dropEffect = "move";
|
|
1024
|
+
if (dragRef.current && dragRef.current !== pluginId) {
|
|
1025
|
+
setDragOverId(pluginId);
|
|
1026
|
+
}
|
|
1027
|
+
}, []);
|
|
1028
|
+
const handleDrop = useCallback((e, targetId) => {
|
|
1029
|
+
e.preventDefault();
|
|
1030
|
+
const srcId = dragRef.current;
|
|
1031
|
+
if (!srcId || srcId === targetId) {
|
|
1032
|
+
dragRef.current = null;
|
|
1033
|
+
setDraggingId(null);
|
|
1034
|
+
setDragOverId(null);
|
|
1035
|
+
return;
|
|
1036
|
+
}
|
|
1037
|
+
// Materialize current sorted order, then splice
|
|
1038
|
+
if (!allowCustomOrder)
|
|
1039
|
+
return;
|
|
1040
|
+
setPluginOrder(() => {
|
|
1041
|
+
// Build full order: items in custom order first, then any new ones
|
|
1042
|
+
const allIds = nonDbPlugins.map((p) => p.id);
|
|
1043
|
+
let ids;
|
|
1044
|
+
if (pluginOrder.length > 0) {
|
|
1045
|
+
const known = new Set(pluginOrder);
|
|
1046
|
+
ids = [...pluginOrder, ...allIds.filter((id) => !known.has(id))];
|
|
1047
|
+
}
|
|
1048
|
+
else {
|
|
1049
|
+
ids = sorted.map((p) => p.id);
|
|
1050
|
+
// Pad with any nonDbPlugins not currently in sorted (due to filters)
|
|
1051
|
+
const inSorted = new Set(ids);
|
|
1052
|
+
for (const id of allIds) {
|
|
1053
|
+
if (!inSorted.has(id))
|
|
1054
|
+
ids.push(id);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
const fromIdx = ids.indexOf(srcId);
|
|
1058
|
+
const toIdx = ids.indexOf(targetId);
|
|
1059
|
+
if (fromIdx === -1 || toIdx === -1)
|
|
1060
|
+
return ids;
|
|
1061
|
+
ids.splice(fromIdx, 1);
|
|
1062
|
+
ids.splice(toIdx, 0, srcId);
|
|
1063
|
+
return ids;
|
|
1064
|
+
});
|
|
1065
|
+
dragRef.current = null;
|
|
1066
|
+
setDraggingId(null);
|
|
1067
|
+
setDragOverId(null);
|
|
1068
|
+
}, [allowCustomOrder, nonDbPlugins, pluginOrder, sorted]);
|
|
1069
|
+
const handleDragEnd = useCallback(() => {
|
|
1070
|
+
dragRef.current = null;
|
|
1071
|
+
setDraggingId(null);
|
|
1072
|
+
setDragOverId(null);
|
|
1073
|
+
}, []);
|
|
1074
|
+
const handleResetOrder = useCallback(() => {
|
|
1075
|
+
setPluginOrder([]);
|
|
1076
|
+
localStorage.removeItem("pluginOrder");
|
|
1077
|
+
}, []);
|
|
1078
|
+
const renderResolvedIcon = useCallback((plugin, options) => {
|
|
1079
|
+
const icon = resolveIcon(plugin);
|
|
1080
|
+
if (!icon) {
|
|
1081
|
+
return _jsx("span", { className: options?.emojiClassName ?? "text-sm", children: "\uD83E\uDDE9" });
|
|
1082
|
+
}
|
|
1083
|
+
if (typeof icon === "string") {
|
|
1084
|
+
const imageSrc = iconImageSource(icon);
|
|
1085
|
+
return imageSrc ? (_jsx("img", { src: imageSrc, alt: "", className: options?.className ?? "w-5 h-5 rounded-sm object-contain", onError: (e) => {
|
|
1086
|
+
e.currentTarget.style.display = "none";
|
|
1087
|
+
} })) : (_jsx("span", { className: options?.emojiClassName ?? "text-sm", children: icon }));
|
|
1088
|
+
}
|
|
1089
|
+
const IconComponent = icon;
|
|
1090
|
+
return _jsx(IconComponent, { className: options?.className ?? "w-5 h-5" });
|
|
1091
|
+
}, []);
|
|
1092
|
+
// ── Card renderers ────────────────────────────────────────────────
|
|
1093
|
+
const renderPluginCard = (p) => {
|
|
1094
|
+
const hasParams = p.parameters && p.parameters.length > 0;
|
|
1095
|
+
const isOpen = pluginSettingsOpen.has(p.id);
|
|
1096
|
+
const setCount = hasParams
|
|
1097
|
+
? p.parameters.filter((param) => param.isSet).length
|
|
1098
|
+
: 0;
|
|
1099
|
+
const totalCount = hasParams ? p.parameters.length : 0;
|
|
1100
|
+
const allParamsSet = !hasParams || setCount === totalCount;
|
|
1101
|
+
const isShowcase = p.id === "__ui-showcase__";
|
|
1102
|
+
const categoryLabel = isShowcase
|
|
1103
|
+
? "showcase"
|
|
1104
|
+
: p.category === "ai-provider"
|
|
1105
|
+
? "ai provider"
|
|
1106
|
+
: p.category;
|
|
1107
|
+
const enabledBorder = isShowcase
|
|
1108
|
+
? "border-l-[3px] border-l-accent"
|
|
1109
|
+
: p.enabled
|
|
1110
|
+
? !allParamsSet && hasParams
|
|
1111
|
+
? "border-l-[3px] border-l-warn"
|
|
1112
|
+
: "border-l-[3px] border-l-accent"
|
|
1113
|
+
: "";
|
|
1114
|
+
const isToggleBusy = togglingPlugins.has(p.id);
|
|
1115
|
+
const toggleDisabled = isToggleBusy || (hasPluginToggleInFlight && !isToggleBusy);
|
|
1116
|
+
const isDragging = draggingId === p.id;
|
|
1117
|
+
const isDragOver = dragOverId === p.id && draggingId !== p.id;
|
|
1118
|
+
const pluginLinks = getPluginResourceLinks(p);
|
|
1119
|
+
return (_jsxs("li", { draggable: allowCustomOrder, onDragStart: allowCustomOrder ? (e) => handleDragStart(e, p.id) : undefined, onDragOver: allowCustomOrder ? (e) => handleDragOver(e, p.id) : undefined, onDrop: allowCustomOrder ? (e) => handleDrop(e, p.id) : undefined, onDragEnd: allowCustomOrder ? handleDragEnd : undefined, className: `border border-border bg-card transition-colors duration-150 flex flex-col ${enabledBorder} ${isOpen ? "ring-1 ring-accent" : "hover:border-accent/40"} ${isDragging ? "opacity-30" : ""} ${isDragOver ? "ring-2 ring-accent/60" : ""}`, "data-plugin-id": p.id, children: [_jsxs("div", { className: "flex items-center gap-2 px-3 pt-3 pb-1", children: [allowCustomOrder && (_jsx("span", { className: "text-[10px] text-muted opacity-30 hover:opacity-70 cursor-grab active:cursor-grabbing shrink-0 select-none leading-none", title: t("pluginsview.DragToReorder"), children: t("pluginsview.X2807") })), _jsxs("span", { className: "font-bold text-sm flex items-center gap-1.5 min-w-0 truncate flex-1", children: [(() => {
|
|
1120
|
+
const icon = resolveIcon(p);
|
|
1121
|
+
if (!icon)
|
|
1122
|
+
return null;
|
|
1123
|
+
if (typeof icon === "string") {
|
|
1124
|
+
const imageSrc = iconImageSource(icon);
|
|
1125
|
+
return imageSrc ? (_jsx("img", { src: imageSrc, alt: "", className: "w-5 h-5 rounded-sm object-contain", onError: (e) => {
|
|
1126
|
+
e.currentTarget.style.display =
|
|
1127
|
+
"none";
|
|
1128
|
+
} })) : (_jsx("span", { className: "text-sm", children: icon }));
|
|
1129
|
+
}
|
|
1130
|
+
const IconComponent = icon;
|
|
1131
|
+
return _jsx(IconComponent, { className: "w-5 h-5" });
|
|
1132
|
+
})(), p.name] }), isShowcase ? (_jsx("span", { className: "text-[10px] font-bold tracking-wider px-2.5 py-[2px] border border-accent text-txt bg-accent-subtle shrink-0", children: t("pluginsview.DEMO") })) : (_jsx("button", { type: "button", "data-plugin-toggle": p.id, className: `text-[10px] font-bold tracking-wider px-2.5 py-[2px] border transition-colors duration-150 shrink-0 ${p.enabled
|
|
1133
|
+
? "bg-accent text-accent-fg border-accent"
|
|
1134
|
+
: "bg-transparent text-muted border-border hover:text-txt"} ${toggleDisabled
|
|
1135
|
+
? "opacity-60 cursor-not-allowed"
|
|
1136
|
+
: "cursor-pointer"}`, onClick: (e) => {
|
|
1137
|
+
e.stopPropagation();
|
|
1138
|
+
void handleTogglePlugin(p.id, !p.enabled);
|
|
1139
|
+
}, disabled: toggleDisabled, children: isToggleBusy ? "APPLYING" : p.enabled ? "ON" : "OFF" }))] }), _jsxs("div", { className: "flex items-center gap-1.5 px-3 pb-1.5", children: [_jsx("span", { className: "text-[10px] px-1.5 py-px border border-border bg-surface text-muted lowercase tracking-wide whitespace-nowrap", children: categoryLabel }), p.version && (_jsxs("span", { className: "text-[10px] font-mono text-muted opacity-70", children: ["v", p.version] })), p.enabled && !p.isActive && !isShowcase && (_jsx("span", { className: `text-[10px] px-1.5 py-px border lowercase tracking-wide whitespace-nowrap ${p.loadError
|
|
1140
|
+
? "border-destructive bg-[rgba(153,27,27,0.04)] text-destructive"
|
|
1141
|
+
: "border-warn bg-[rgba(234,179,8,0.06)] text-warn"}`, title: p.loadError || "Plugin is enabled but not loaded in the runtime", children: p.loadError ? "load failed" : "not installed" })), isToggleBusy && (_jsx("span", { className: "text-[10px] px-1.5 py-px border border-accent bg-accent-subtle text-txt lowercase tracking-wide whitespace-nowrap", children: t("pluginsview.restarting") }))] }), _jsx("p", { className: "text-xs text-muted px-3 pb-2 flex-1", style: {
|
|
1142
|
+
display: "-webkit-box",
|
|
1143
|
+
WebkitLineClamp: 3,
|
|
1144
|
+
WebkitBoxOrient: "vertical",
|
|
1145
|
+
overflow: "hidden",
|
|
1146
|
+
}, children: p.description || "No description available" }), (p.tags?.length ?? 0) > 0 && (_jsx("div", { className: "flex flex-wrap gap-1.5 px-3 pb-2", children: p.tags?.slice(0, 4).map((tag) => (_jsx("span", { className: "text-[10px] px-1.5 py-px border border-border/50 bg-black/10 text-muted lowercase tracking-wide whitespace-nowrap", children: tag }, `${p.id}:${tag}`))) })), pluginLinks.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2 px-3 pb-2", children: pluginLinks.map((link) => (_jsx(Button, { variant: "outline", size: "sm", className: "h-6 px-2 text-[10px] font-bold border-border/40 text-muted hover:text-txt hover:border-accent hover:bg-accent/5 backdrop-blur-sm transition-all", onClick: (e) => {
|
|
1147
|
+
e.stopPropagation();
|
|
1148
|
+
void handleOpenPluginExternalUrl(link.url);
|
|
1149
|
+
}, title: `${link.label}: ${link.url}`, children: link.label }, `${p.id}:${link.key}`))) })), _jsxs("div", { className: "flex items-center gap-3 px-4 py-3 border-t border-border/40 mt-auto bg-black/5", children: [hasParams && !isShowcase ? (_jsxs(_Fragment, { children: [_jsx("span", { className: `inline-block w-2 h-2 rounded-full shadow-[0_0_10px_currentColor] shrink-0 ${allParamsSet
|
|
1150
|
+
? "bg-ok text-ok"
|
|
1151
|
+
: "bg-destructive text-destructive"}` }), _jsxs("span", { className: "text-[11px] font-bold tracking-wide text-muted", children: [setCount, "/", totalCount, " ", t("pluginsview.configured")] })] })) : !hasParams && !isShowcase ? (_jsx("span", { className: "text-[11px] font-bold tracking-wide text-muted/60", children: t("pluginsview.NoConfigNeeded") })) : (_jsx("span", { className: "text-[11px] font-bold tracking-wide text-muted/60", children: t("pluginsview.23FieldDemos") })), _jsx("div", { className: "flex-1" }), p.enabled &&
|
|
1152
|
+
!p.isActive &&
|
|
1153
|
+
p.npmName &&
|
|
1154
|
+
!isShowcase &&
|
|
1155
|
+
!p.loadError && (_jsx(Button, { variant: "default", size: "sm", className: "h-7 px-3 text-[10px] font-bold tracking-wide shadow-sm max-w-[140px] truncate", disabled: installingPlugins.has(p.id), onClick: (e) => {
|
|
1156
|
+
e.stopPropagation();
|
|
1157
|
+
handleInstallPlugin(p.id, p.npmName ?? "");
|
|
1158
|
+
}, children: installingPlugins.has(p.id)
|
|
1159
|
+
? installProgress.get(p.npmName ?? "")?.message ||
|
|
1160
|
+
"Installing..."
|
|
1161
|
+
: "Install" })), hasParams && (_jsxs(Button, { variant: "ghost", size: "sm", className: `h-7 px-2.5 text-[11px] font-bold transition-all flex items-center gap-1.5 ${isOpen
|
|
1162
|
+
? "text-txt bg-accent/10 hover:bg-accent/20"
|
|
1163
|
+
: "text-muted hover:text-txt hover:bg-white/5"}`, onClick: (e) => {
|
|
1164
|
+
e.stopPropagation();
|
|
1165
|
+
toggleSettings(p.id);
|
|
1166
|
+
}, title: t("pluginsview.Settings"), children: [_jsx("span", { className: "text-[14px] leading-none", children: "\u2699" }), _jsx("span", { className: `inline-block text-[10px] transition-transform duration-200 ${isOpen ? "rotate-90" : ""}`, children: "\u25B6" })] }))] }), p.enabled && p.validationErrors && p.validationErrors.length > 0 && (_jsx("div", { className: "px-3 py-1.5 border-t border-destructive bg-[rgba(153,27,27,0.04)] text-xs", children: p.validationErrors.map((err) => (_jsxs("div", { className: "text-destructive mb-0.5 text-[10px]", children: [err.field, ": ", err.message] }, `${err.field}:${err.message}`))) })), p.enabled &&
|
|
1167
|
+
p.validationWarnings &&
|
|
1168
|
+
p.validationWarnings.length > 0 && (_jsx("div", { className: "px-3 py-1", children: p.validationWarnings.map((w) => (_jsx("div", { className: "text-warn text-[10px]", children: w.message }, `${w.field}:${w.message}`))) }))] }, p.id));
|
|
1169
|
+
};
|
|
1170
|
+
/** Render a grid of plugin cards. */
|
|
1171
|
+
const renderPluginGrid = (plugins) => (_jsx("ul", { className: "grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-3 m-0 p-0 list-none", children: plugins.map((p) => renderPluginCard(p)) }));
|
|
1172
|
+
// Resolve the plugin whose settings dialog is currently open.
|
|
1173
|
+
// Exclude ai-provider plugins — those are configured in Settings.
|
|
1174
|
+
const settingsDialogPlugin = Array.from(pluginSettingsOpen)
|
|
1175
|
+
.map((id) => nonDbPlugins.find((plugin) => plugin.id === id) ?? null)
|
|
1176
|
+
.find((plugin) => (plugin?.parameters?.length ?? 0) > 0) ?? null;
|
|
1177
|
+
// ── Game-modal state ──────────────────────────────────────────────
|
|
1178
|
+
const [gameSelectedId, setGameSelectedId] = useState(null);
|
|
1179
|
+
const [gameMobileDetail, setGameMobileDetail] = useState(false);
|
|
1180
|
+
const gameNarrow = typeof window !== "undefined" && typeof window.matchMedia === "function"
|
|
1181
|
+
? window.matchMedia("(max-width: 600px)").matches
|
|
1182
|
+
: false;
|
|
1183
|
+
const [connectorExpandedIds, setConnectorExpandedIds] = useState(() => new Set());
|
|
1184
|
+
const [connectorSelectedId, setConnectorSelectedId] = useState(null);
|
|
1185
|
+
const [desktopConnectorLayout, setDesktopConnectorLayout] = useState(() => typeof window !== "undefined" && typeof window.matchMedia === "function"
|
|
1186
|
+
? window.matchMedia("(min-width: 1024px)").matches
|
|
1187
|
+
: false);
|
|
1188
|
+
const connectorSectionRefs = useRef({});
|
|
1189
|
+
// Auto-select first visible plugin in game modal
|
|
1190
|
+
const gameVisiblePlugins = visiblePlugins.filter((p) => p.id !== "__ui-showcase__");
|
|
1191
|
+
const effectiveGameSelected = gameVisiblePlugins.find((p) => p.id === gameSelectedId)
|
|
1192
|
+
? gameSelectedId
|
|
1193
|
+
: (gameVisiblePlugins[0]?.id ?? null);
|
|
1194
|
+
const selectedPlugin = gameVisiblePlugins.find((p) => p.id === effectiveGameSelected) ?? null;
|
|
1195
|
+
const selectedPluginLinks = selectedPlugin
|
|
1196
|
+
? getPluginResourceLinks(selectedPlugin)
|
|
1197
|
+
: [];
|
|
1198
|
+
useEffect(() => {
|
|
1199
|
+
if (!isSocialMode || !inModal)
|
|
1200
|
+
return;
|
|
1201
|
+
if (pluginStatusFilter !== "disabled")
|
|
1202
|
+
return;
|
|
1203
|
+
setState("pluginStatusFilter", "all");
|
|
1204
|
+
}, [inModal, isSocialMode, pluginStatusFilter, setState]);
|
|
1205
|
+
useEffect(() => {
|
|
1206
|
+
if (!isSocialMode || !inModal)
|
|
1207
|
+
return;
|
|
1208
|
+
if (typeof window === "undefined" ||
|
|
1209
|
+
typeof window.matchMedia !== "function")
|
|
1210
|
+
return;
|
|
1211
|
+
const media = window.matchMedia("(min-width: 1024px)");
|
|
1212
|
+
const syncLayout = () => {
|
|
1213
|
+
setDesktopConnectorLayout(media.matches);
|
|
1214
|
+
};
|
|
1215
|
+
syncLayout();
|
|
1216
|
+
if (typeof media.addEventListener === "function") {
|
|
1217
|
+
media.addEventListener("change", syncLayout);
|
|
1218
|
+
return () => media.removeEventListener("change", syncLayout);
|
|
1219
|
+
}
|
|
1220
|
+
media.addListener(syncLayout);
|
|
1221
|
+
return () => media.removeListener(syncLayout);
|
|
1222
|
+
}, [inModal, isSocialMode]);
|
|
1223
|
+
useEffect(() => {
|
|
1224
|
+
if (!isSocialMode || !inModal)
|
|
1225
|
+
return;
|
|
1226
|
+
if (visiblePlugins.length === 0) {
|
|
1227
|
+
setConnectorSelectedId(null);
|
|
1228
|
+
setConnectorExpandedIds(new Set());
|
|
1229
|
+
return;
|
|
1230
|
+
}
|
|
1231
|
+
setConnectorSelectedId((prev) => {
|
|
1232
|
+
if (visiblePlugins.some((plugin) => plugin.id === prev)) {
|
|
1233
|
+
return prev;
|
|
1234
|
+
}
|
|
1235
|
+
return desktopConnectorLayout ? (visiblePlugins[0]?.id ?? null) : null;
|
|
1236
|
+
});
|
|
1237
|
+
}, [desktopConnectorLayout, inModal, isSocialMode, visiblePlugins]);
|
|
1238
|
+
useEffect(() => {
|
|
1239
|
+
if (!isSocialMode || !inModal || !desktopConnectorLayout)
|
|
1240
|
+
return;
|
|
1241
|
+
if (!connectorSelectedId)
|
|
1242
|
+
return;
|
|
1243
|
+
setConnectorExpandedIds(new Set([connectorSelectedId]));
|
|
1244
|
+
}, [connectorSelectedId, desktopConnectorLayout, inModal, isSocialMode]);
|
|
1245
|
+
useEffect(() => {
|
|
1246
|
+
if (!isSocialMode || !inModal || desktopConnectorLayout)
|
|
1247
|
+
return;
|
|
1248
|
+
setConnectorExpandedIds(new Set());
|
|
1249
|
+
}, [desktopConnectorLayout, inModal, isSocialMode]);
|
|
1250
|
+
const scrollConnectorIntoView = useCallback((pluginId) => {
|
|
1251
|
+
const element = connectorSectionRefs.current[pluginId];
|
|
1252
|
+
if (element && typeof element.scrollIntoView === "function") {
|
|
1253
|
+
element.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
1254
|
+
}
|
|
1255
|
+
}, []);
|
|
1256
|
+
const handleConnectorSelect = useCallback((pluginId) => {
|
|
1257
|
+
setConnectorSelectedId(pluginId);
|
|
1258
|
+
setConnectorExpandedIds((prev) => {
|
|
1259
|
+
if (desktopConnectorLayout) {
|
|
1260
|
+
return new Set([pluginId]);
|
|
1261
|
+
}
|
|
1262
|
+
const next = new Set(prev);
|
|
1263
|
+
next.add(pluginId);
|
|
1264
|
+
return next;
|
|
1265
|
+
});
|
|
1266
|
+
scrollConnectorIntoView(pluginId);
|
|
1267
|
+
}, [desktopConnectorLayout, scrollConnectorIntoView]);
|
|
1268
|
+
const handleConnectorSectionToggle = useCallback((pluginId) => {
|
|
1269
|
+
setConnectorSelectedId(pluginId);
|
|
1270
|
+
setConnectorExpandedIds((prev) => {
|
|
1271
|
+
if (desktopConnectorLayout) {
|
|
1272
|
+
return new Set([pluginId]);
|
|
1273
|
+
}
|
|
1274
|
+
const next = new Set(prev);
|
|
1275
|
+
if (next.has(pluginId))
|
|
1276
|
+
next.delete(pluginId);
|
|
1277
|
+
else
|
|
1278
|
+
next.add(pluginId);
|
|
1279
|
+
return next;
|
|
1280
|
+
});
|
|
1281
|
+
if (desktopConnectorLayout) {
|
|
1282
|
+
scrollConnectorIntoView(pluginId);
|
|
1283
|
+
}
|
|
1284
|
+
}, [desktopConnectorLayout, scrollConnectorIntoView]);
|
|
1285
|
+
// ── Game-modal render ─────────────────────────────────────────────
|
|
1286
|
+
if (inModal && isSocialMode) {
|
|
1287
|
+
return (_jsxs("div", { "data-testid": "plugins-view-social", className: `flex min-h-full min-w-0 w-full flex-col bg-bg ${desktopConnectorLayout ? "md:flex-row" : ""}`, children: [desktopConnectorLayout && (_jsx("aside", { "data-testid": "connectors-settings-sidebar", className: "flex w-[22rem] shrink-0 border-r border-border/50 bg-bg/35 backdrop-blur-xl", children: _jsxs("div", { className: "flex min-h-full flex-1 flex-col sticky top-0 max-h-screen", children: [_jsxs("div", { className: "border-b border-border/40 px-5 py-5", children: [_jsx("div", { className: "text-[11px] font-semibold uppercase tracking-[0.18em] text-muted/80", children: "Connectors" }), _jsxs("div", { className: "mt-2 text-sm text-muted", children: [enabledCount, " enabled of ", categoryPlugins.length] })] }), _jsx("nav", { className: "flex-1 space-y-2 overflow-y-auto px-4 py-4", children: (desktopConnectorLayout
|
|
1288
|
+
? visiblePlugins.filter((plugin) => {
|
|
1289
|
+
return plugin.id === connectorSelectedId;
|
|
1290
|
+
})
|
|
1291
|
+
: visiblePlugins).map((plugin) => {
|
|
1292
|
+
const isSelected = connectorSelectedId === plugin.id;
|
|
1293
|
+
const isExpanded = connectorExpandedIds.has(plugin.id);
|
|
1294
|
+
const isToggleBusy = togglingPlugins.has(plugin.id);
|
|
1295
|
+
const toggleDisabled = isToggleBusy || (hasPluginToggleInFlight && !isToggleBusy);
|
|
1296
|
+
return (_jsxs("div", { className: `flex items-center gap-2 rounded-2xl border px-3 py-2 transition-all ${isSelected
|
|
1297
|
+
? "border-accent/40 bg-accent/10 text-txt shadow-[0_10px_30px_rgba(var(--accent),0.08)]"
|
|
1298
|
+
: "border-transparent bg-transparent text-muted hover:border-border/60 hover:bg-card/55 hover:text-txt"}`, children: [_jsxs("button", { type: "button", className: "flex min-w-0 flex-1 items-center gap-3 text-left", onClick: () => handleConnectorSelect(plugin.id), "aria-current": isSelected ? "page" : undefined, children: [_jsx("span", { className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-xl border ${isSelected
|
|
1299
|
+
? "border-accent/30 bg-accent/18 text-txt-strong"
|
|
1300
|
+
: "border-border/50 bg-bg-accent/80 text-muted"}`, children: renderResolvedIcon(plugin, {
|
|
1301
|
+
className: "w-4 h-4 rounded-sm object-contain",
|
|
1302
|
+
emojiClassName: "text-sm",
|
|
1303
|
+
}) }), _jsx("span", { className: "min-w-0 flex-1 truncate text-sm font-semibold leading-none", children: plugin.name })] }), _jsx("button", { type: "button", className: `shrink-0 rounded-full border px-2.5 py-1 text-[10px] font-bold tracking-[0.16em] transition-colors ${plugin.enabled
|
|
1304
|
+
? "border-accent bg-accent text-accent-fg"
|
|
1305
|
+
: "border-border bg-transparent text-muted hover:border-accent/40 hover:text-txt"} ${toggleDisabled
|
|
1306
|
+
? "cursor-not-allowed opacity-60"
|
|
1307
|
+
: "cursor-pointer"}`, onClick: () => void handleTogglePlugin(plugin.id, !plugin.enabled), disabled: toggleDisabled, children: isToggleBusy ? "..." : plugin.enabled ? "ON" : "OFF" }), _jsx("span", { className: `shrink-0 text-muted transition-transform ${isExpanded ? "rotate-90" : ""}`, children: _jsx(ChevronRight, { className: "h-4 w-4" }) })] }, plugin.id));
|
|
1308
|
+
}) })] }) })), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "sticky top-0 z-20 border-b border-border/50 bg-bg/85 px-4 py-4 shadow-[0_12px_30px_rgba(0,0,0,0.14)] backdrop-blur-xl sm:px-6 lg:px-8", children: _jsx("div", { className: "mx-auto max-w-5xl", children: _jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center", children: [_jsx(Input, { type: "text", className: "h-11 w-full rounded-xl border-border/60 bg-card/70 text-sm shadow-sm", placeholder: "Search connectors...", value: pluginSearch, onChange: (e) => setState("pluginSearch", e.target.value) }), _jsx("div", { className: "flex shrink-0 gap-1.5 rounded-xl border border-white/5 bg-black/10 p-1", children: ["all", "enabled"].map((status) => (_jsx(Button, { variant: effectiveStatusFilter === status ? "default" : "ghost", size: "sm", className: `h-8 px-3 text-[11px] font-bold tracking-wide transition-all ${effectiveStatusFilter === status
|
|
1309
|
+
? "shadow-sm"
|
|
1310
|
+
: "text-muted hover:bg-white/5 hover:text-txt"}`, onClick: () => setState("pluginStatusFilter", status), children: status === "all"
|
|
1311
|
+
? `All (${categoryPlugins.length})`
|
|
1312
|
+
: `Enabled (${enabledCount})` }, status))) })] }) }) }), _jsxs("div", { className: "mx-auto max-w-5xl px-4 py-4 sm:px-6 sm:py-5 lg:px-8 lg:py-6", children: [hasPluginToggleInFlight && (_jsx("div", { className: "mb-4 rounded-2xl border border-accent bg-accent-subtle px-4 py-3 text-[11px] text-txt", children: t("pluginsview.ApplyingPluginChan") })), visiblePlugins.length === 0 ? (_jsx("div", { className: "rounded-2xl border border-dashed border-border px-5 py-10 text-center text-muted", children: effectiveSearch
|
|
1313
|
+
? "No connectors match your search."
|
|
1314
|
+
: "No connectors match your filters." })) : (_jsx("div", { "data-testid": "connectors-settings-content", className: "space-y-4", children: visiblePlugins.map((plugin) => {
|
|
1315
|
+
const hasParams = (plugin.parameters?.length ?? 0) > 0 &&
|
|
1316
|
+
plugin.id !== "__ui-showcase__";
|
|
1317
|
+
const isExpanded = connectorExpandedIds.has(plugin.id);
|
|
1318
|
+
const isSelected = connectorSelectedId === plugin.id;
|
|
1319
|
+
const setCount = hasParams
|
|
1320
|
+
? plugin.parameters.filter((param) => param.isSet).length
|
|
1321
|
+
: 0;
|
|
1322
|
+
const totalCount = hasParams ? plugin.parameters.length : 0;
|
|
1323
|
+
const allParamsSet = !hasParams || setCount === totalCount;
|
|
1324
|
+
const isToggleBusy = togglingPlugins.has(plugin.id);
|
|
1325
|
+
const toggleDisabled = isToggleBusy || (hasPluginToggleInFlight && !isToggleBusy);
|
|
1326
|
+
const isSaving = pluginSaving.has(plugin.id);
|
|
1327
|
+
const saveSuccess = pluginSaveSuccess.has(plugin.id);
|
|
1328
|
+
const testResult = testResults.get(plugin.id);
|
|
1329
|
+
const pluginLinks = getPluginResourceLinks(plugin);
|
|
1330
|
+
return (_jsxs("section", { ref: (element) => {
|
|
1331
|
+
connectorSectionRefs.current[plugin.id] = element;
|
|
1332
|
+
}, "data-testid": `connector-section-${plugin.id}`, className: `overflow-hidden rounded-[1.4rem] border bg-card/90 shadow-sm transition-all ${isSelected
|
|
1333
|
+
? "border-accent/35 shadow-[0_18px_40px_rgba(var(--accent),0.08)]"
|
|
1334
|
+
: "border-border/50"}`, children: [_jsxs("div", { className: "flex items-start gap-3 px-4 py-4 sm:px-5", children: [_jsxs("button", { type: "button", "data-testid": `connector-header-${plugin.id}`, className: "flex min-w-0 flex-1 items-start gap-3 text-left", onClick: () => handleConnectorSectionToggle(plugin.id), children: [_jsx("span", { className: `mt-0.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl border ${isSelected
|
|
1335
|
+
? "border-accent/30 bg-accent/18 text-txt-strong"
|
|
1336
|
+
: "border-border/50 bg-bg-accent/80 text-muted"}`, children: renderResolvedIcon(plugin, {
|
|
1337
|
+
className: "w-4 h-4 rounded-sm object-contain",
|
|
1338
|
+
emojiClassName: "text-base",
|
|
1339
|
+
}) }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsxs("span", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [_jsx("span", { className: "truncate text-sm font-semibold text-txt", children: plugin.name }), _jsx("span", { className: `rounded-full border px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.14em] ${allParamsSet
|
|
1340
|
+
? "border-ok/30 bg-ok/10 text-ok"
|
|
1341
|
+
: "border-warn/30 bg-warn/10 text-warn"}`, children: allParamsSet ? "Ready" : "Needs setup" }), plugin.version && (_jsxs("span", { className: "text-[11px] font-mono text-muted/80", children: ["v", plugin.version] }))] }), _jsx("span", { className: "mt-1 block text-sm text-muted", children: plugin.description || "No description available" }), _jsxs("span", { className: "mt-2 flex flex-wrap items-center gap-2 text-[11px] text-muted", children: [_jsx("span", { children: hasParams
|
|
1342
|
+
? `${setCount}/${totalCount} configured`
|
|
1343
|
+
: "No configuration needed" }), plugin.enabled && !plugin.isActive && (_jsx("span", { className: `rounded-full border px-2 py-0.5 ${plugin.loadError
|
|
1344
|
+
? "border-danger/30 bg-danger/10 text-danger"
|
|
1345
|
+
: "border-warn/30 bg-warn/10 text-warn"}`, children: plugin.loadError
|
|
1346
|
+
? "Load failed"
|
|
1347
|
+
: "Not installed" }))] })] })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [_jsx("button", { type: "button", className: `rounded-full border px-3 py-1.5 text-[10px] font-bold tracking-[0.16em] transition-colors ${plugin.enabled
|
|
1348
|
+
? "border-accent bg-accent text-accent-fg"
|
|
1349
|
+
: "border-border bg-transparent text-muted hover:border-accent/40 hover:text-txt"} ${toggleDisabled
|
|
1350
|
+
? "cursor-not-allowed opacity-60"
|
|
1351
|
+
: "cursor-pointer"}`, onClick: () => void handleTogglePlugin(plugin.id, !plugin.enabled), disabled: toggleDisabled, children: isToggleBusy
|
|
1352
|
+
? "..."
|
|
1353
|
+
: plugin.enabled
|
|
1354
|
+
? "ON"
|
|
1355
|
+
: "OFF" }), _jsxs("button", { type: "button", className: `flex items-center gap-1 rounded-full border px-3 py-1.5 text-[11px] font-semibold transition-colors ${isExpanded
|
|
1356
|
+
? "border-accent/40 bg-accent/10 text-txt"
|
|
1357
|
+
: "border-border/50 text-muted hover:border-accent/40 hover:text-txt"}`, onClick: () => handleConnectorSectionToggle(plugin.id), "aria-expanded": isExpanded, "aria-label": `${isExpanded ? "Collapse" : "Expand"} ${plugin.name}`, children: [_jsx("span", { children: isExpanded ? "Collapse" : "Expand" }), _jsx(ChevronRight, { className: `h-4 w-4 transition-transform ${isExpanded ? "rotate-90" : ""}` })] })] })] }), isExpanded && (_jsxs("div", { className: "border-t border-border/40 bg-black/5 px-4 py-4 sm:px-5", children: [plugin.validationErrors &&
|
|
1358
|
+
plugin.validationErrors.length > 0 && (_jsx("div", { className: "mb-4 rounded-2xl border border-danger/30 bg-danger/10 px-4 py-3 text-sm text-danger", children: plugin.validationErrors.map((error) => (_jsxs("div", { children: [error.field, ": ", error.message] }, `${plugin.id}:${error.field}:${error.message}`))) })), plugin.validationWarnings &&
|
|
1359
|
+
plugin.validationWarnings.length > 0 && (_jsx("div", { className: "mb-4 rounded-2xl border border-warn/30 bg-warn/10 px-4 py-3 text-sm text-warn", children: plugin.validationWarnings.map((warning) => (_jsx("div", { children: warning.message }, `${plugin.id}:${warning.field}:${warning.message}`))) })), pluginLinks.length > 0 && (_jsx("div", { className: "mb-4 flex flex-wrap gap-2", children: pluginLinks.map((link) => (_jsx(Button, { variant: "outline", size: "sm", className: "h-8 rounded-xl border-border/40 bg-card/40 px-3 text-[11px] font-semibold text-muted transition-all hover:border-accent hover:bg-accent/5 hover:text-txt", onClick: () => {
|
|
1360
|
+
void handleOpenPluginExternalUrl(link.url);
|
|
1361
|
+
}, title: `${link.label}: ${link.url}`, children: link.label }, `${plugin.id}:${link.key}`))) })), plugin.enabled &&
|
|
1362
|
+
!plugin.isActive &&
|
|
1363
|
+
plugin.npmName &&
|
|
1364
|
+
!plugin.loadError && (_jsx("div", { className: "mb-4 rounded-2xl border border-warn/30 bg-warn/10 px-4 py-3 text-sm text-txt", children: _jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [_jsx("div", { children: "Install this connector to activate it in the runtime." }), _jsx(Button, { variant: "default", size: "sm", className: "h-8 rounded-xl px-4 text-[11px] font-bold", disabled: installingPlugins.has(plugin.id), onClick: () => handleInstallPlugin(plugin.id, plugin.npmName ?? ""), children: installingPlugins.has(plugin.id)
|
|
1365
|
+
? installProgress.get(plugin.npmName ?? "")?.message || "Installing..."
|
|
1366
|
+
: "Install Plugin" })] }) })), hasParams ? (_jsxs("div", { className: "space-y-4", children: [_jsx(PluginConfigForm, { plugin: plugin, pluginConfigs: pluginConfigs, onParamChange: handleParamChange }), plugin.id === "whatsapp" && (_jsx(WhatsAppQrOverlay, { accountId: "default" }))] })) : (_jsx("div", { className: "rounded-2xl border border-border/40 bg-card/40 px-4 py-3 text-sm text-muted", children: "No configuration needed." })), _jsxs("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [plugin.isActive && (_jsx(Button, { variant: testResult?.success
|
|
1367
|
+
? "default"
|
|
1368
|
+
: testResult?.error
|
|
1369
|
+
? "destructive"
|
|
1370
|
+
: "outline", size: "sm", className: `h-8 rounded-xl px-4 text-[11px] font-bold transition-all ${testResult?.loading
|
|
1371
|
+
? "cursor-wait opacity-70"
|
|
1372
|
+
: testResult?.success
|
|
1373
|
+
? "border-ok bg-ok text-ok-fg hover:bg-ok/90"
|
|
1374
|
+
: testResult?.error
|
|
1375
|
+
? "border-danger bg-danger text-danger-fg hover:bg-danger/90"
|
|
1376
|
+
: "border-border/40 bg-card/40 hover:border-accent/40"}`, disabled: testResult?.loading, onClick: () => void handleTestConnection(plugin.id), children: testResult?.loading
|
|
1377
|
+
? "Testing..."
|
|
1378
|
+
: testResult?.success
|
|
1379
|
+
? `OK (${testResult.durationMs}ms)`
|
|
1380
|
+
: testResult?.error
|
|
1381
|
+
? `Failed: ${testResult.error}`
|
|
1382
|
+
: "Test Connection" })), hasParams && (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "ghost", size: "sm", className: "h-8 rounded-xl px-4 text-[11px] font-semibold text-muted hover:text-txt", onClick: () => handleConfigReset(plugin.id), children: "Reset" }), _jsx(Button, { variant: saveSuccess ? "default" : "secondary", size: "sm", className: `h-8 rounded-xl px-4 text-[11px] font-bold transition-all ${saveSuccess
|
|
1383
|
+
? "bg-ok text-ok-fg hover:bg-ok/90"
|
|
1384
|
+
: "bg-accent text-accent-fg hover:bg-accent/90"}`, onClick: () => void handleConfigSave(plugin.id), disabled: isSaving, children: isSaving
|
|
1385
|
+
? "Saving..."
|
|
1386
|
+
: saveSuccess
|
|
1387
|
+
? "Saved"
|
|
1388
|
+
: "Save Settings" })] }))] })] }))] }, plugin.id));
|
|
1389
|
+
}) }))] })] })] }));
|
|
1390
|
+
}
|
|
1391
|
+
if (inModal) {
|
|
1392
|
+
const sectionTitle = mode === "social"
|
|
1393
|
+
? "Connectors"
|
|
1394
|
+
: mode === "connectors"
|
|
1395
|
+
? "Connectors"
|
|
1396
|
+
: label;
|
|
1397
|
+
return (_jsxs("div", { className: "plugins-game-modal plugins-game-modal--inline", children: [_jsxs("div", { className: `plugins-game-list-panel${gameNarrow && gameMobileDetail ? " is-hidden" : ""}`, children: [_jsx("div", { className: "plugins-game-list-head", children: _jsx("div", { className: "plugins-game-section-title", children: sectionTitle }) }), _jsx("div", { className: "plugins-game-list-scroll", children: gameVisiblePlugins.length === 0 ? (_jsxs("div", { className: "plugins-game-list-empty", children: ["No ", resultLabel, " ", t("pluginsview.found")] })) : (gameVisiblePlugins.map((p) => (_jsxs("button", { type: "button", className: `plugins-game-card${effectiveGameSelected === p.id ? " is-selected" : ""}${!p.enabled ? " is-disabled" : ""}`, onClick: () => {
|
|
1398
|
+
setGameSelectedId(p.id);
|
|
1399
|
+
if (gameNarrow)
|
|
1400
|
+
setGameMobileDetail(true);
|
|
1401
|
+
}, children: [_jsx("div", { className: "plugins-game-card-icon-shell", children: _jsx("span", { className: "plugins-game-card-icon", children: (() => {
|
|
1402
|
+
const icon = resolveIcon(p);
|
|
1403
|
+
if (!icon)
|
|
1404
|
+
return "🧩";
|
|
1405
|
+
if (typeof icon === "string") {
|
|
1406
|
+
const imageSrc = iconImageSource(icon);
|
|
1407
|
+
return imageSrc ? (_jsx("img", { src: imageSrc, alt: "", className: "plugins-game-card-icon", style: { objectFit: "contain" } })) : (icon);
|
|
1408
|
+
}
|
|
1409
|
+
const IconComponent = icon;
|
|
1410
|
+
return _jsx(IconComponent, { className: "w-5 h-5" });
|
|
1411
|
+
})() }) }), _jsxs("div", { className: "plugins-game-card-body", children: [_jsx("div", { className: "plugins-game-card-name", children: p.name }), _jsx("div", { className: "plugins-game-card-meta", children: _jsx("span", { className: `plugins-game-badge ${p.enabled ? "is-on" : "is-off"}`, children: p.enabled ? "ON" : "OFF" }) })] })] }, p.id)))) })] }), _jsx("div", { className: `plugins-game-detail-panel${gameNarrow && !gameMobileDetail ? " is-hidden" : ""}`, children: selectedPlugin ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "plugins-game-detail-head", children: [gameNarrow && (_jsx("button", { type: "button", className: "plugins-game-back-btn", onClick: () => setGameMobileDetail(false), children: t("pluginsview.Back") })), _jsxs("div", { className: "plugins-game-detail-title-row", children: [_jsx("div", { className: "plugins-game-detail-icon-shell", children: _jsx("span", { className: "plugins-game-detail-icon", children: (() => {
|
|
1412
|
+
const icon = resolveIcon(selectedPlugin);
|
|
1413
|
+
if (!icon)
|
|
1414
|
+
return "🧩";
|
|
1415
|
+
if (typeof icon === "string") {
|
|
1416
|
+
const imageSrc = iconImageSource(icon);
|
|
1417
|
+
return imageSrc ? (_jsx("img", { src: imageSrc, alt: "", className: "plugins-game-detail-icon" })) : (icon);
|
|
1418
|
+
}
|
|
1419
|
+
const IconComponent = icon;
|
|
1420
|
+
return _jsx(IconComponent, { className: "w-6 h-6" });
|
|
1421
|
+
})() }) }), _jsxs("div", { className: "plugins-game-detail-main", children: [_jsx("div", { className: "plugins-game-detail-name", children: selectedPlugin.name }), selectedPlugin.version && (_jsxs("span", { className: "plugins-game-version", children: ["v", selectedPlugin.version] }))] }), _jsx("button", { type: "button", className: `plugins-game-toggle ${selectedPlugin.enabled ? "is-on" : "is-off"}`, onClick: () => void handleTogglePlugin(selectedPlugin.id, !selectedPlugin.enabled), disabled: togglingPlugins.has(selectedPlugin.id), children: selectedPlugin.enabled ? "ON" : "OFF" })] })] }), _jsx("div", { className: "plugins-game-detail-description", children: selectedPlugin.description }), (selectedPlugin.tags?.length ?? 0) > 0 && (_jsx("div", { className: "flex flex-wrap gap-1.5 px-3 pb-3", children: selectedPlugin.tags?.map((tag) => (_jsx("span", { className: "text-[10px] px-1.5 py-px border border-border bg-black/10 text-muted lowercase tracking-wide whitespace-nowrap", children: tag }, `${selectedPlugin.id}:${tag}`))) })), selectedPluginLinks.length > 0 && (_jsx("div", { className: "plugins-game-detail-links flex flex-wrap gap-2 px-3 pb-3", children: selectedPluginLinks.map((link) => (_jsx("button", { type: "button", className: "plugins-game-link-btn border border-border bg-transparent px-2.5 py-1 text-[11px] text-muted transition-colors hover:border-accent hover:text-txt", onClick: () => {
|
|
1422
|
+
void handleOpenPluginExternalUrl(link.url);
|
|
1423
|
+
}, children: link.label }, `${selectedPlugin.id}:${link.key}`))) })), selectedPlugin.parameters &&
|
|
1424
|
+
selectedPlugin.parameters.length > 0 && (_jsx("div", { className: "plugins-game-detail-config", children: selectedPlugin.parameters.map((param) => (_jsxs("div", { id: `field-${param.key}`, children: [_jsx("label", { htmlFor: `input-${param.key}`, className: "text-[11px] tracking-wider text-muted block mb-1", children: param.key }), _jsx("input", { id: `input-${param.key}`, type: param.sensitive ? "password" : "text", className: "w-full px-2 py-1 text-[12px]", placeholder: param.description, value: pluginConfigs[selectedPlugin.id]?.[param.key] ??
|
|
1425
|
+
param.currentValue ??
|
|
1426
|
+
"", onChange: (e) => handleParamChange(selectedPlugin.id, param.key, e.target.value) })] }, param.key))) })), _jsxs("div", { className: "plugins-game-detail-actions", children: [_jsx("button", { type: "button", className: "plugins-game-action-btn", onClick: () => void handleTestConnection(selectedPlugin.id), children: t("pluginsview.TestConnection") }), _jsx("button", { type: "button", className: `plugins-game-action-btn plugins-game-save-btn${pluginSaveSuccess.has(selectedPlugin.id) ? " is-saved" : ""}`, onClick: () => void handleConfigSave(selectedPlugin.id), disabled: pluginSaving.has(selectedPlugin.id), children: pluginSaving.has(selectedPlugin.id)
|
|
1427
|
+
? "Saving..."
|
|
1428
|
+
: pluginSaveSuccess.has(selectedPlugin.id)
|
|
1429
|
+
? "Saved!"
|
|
1430
|
+
: "Save" })] })] })) : (_jsxs("div", { className: "plugins-game-detail-empty", children: [_jsx("span", { className: "plugins-game-detail-empty-icon", children: "\uD83E\uDDE9" }), _jsxs("span", { className: "plugins-game-detail-empty-text", children: [t("pluginsview.SelectA"), " ", isConnectorLikeMode ? "connector" : "plugin", " ", t("pluginsview.toC")] })] })) })] }));
|
|
1431
|
+
}
|
|
1432
|
+
// ── Main render ────────────────────────────────────────────────────
|
|
1433
|
+
return (_jsxs("div", { "data-testid": mode === "social" ? "plugins-view-social" : undefined, className: `relative min-h-0 ${showDesktopSubgroupSidebar ? "md:pl-[18rem]" : ""}`, children: [showDesktopSubgroupSidebar && (_jsx("aside", { className: "hidden md:absolute md:left-0 md:top-0 md:block md:w-64", "data-testid": "plugins-subgroup-sidebar", children: _jsxs("div", { className: "sticky top-0 rounded-[28px] border border-border/50 bg-bg/35 p-5 backdrop-blur-xl shadow-sm", children: [_jsx("div", { className: "mb-4 text-[11px] font-semibold uppercase tracking-[0.18em] text-muted/80", children: "Plugin Types" }), _jsx("nav", { className: "flex flex-col gap-2", children: subgroupTags.map((tag) => renderSubgroupFilterButton(tag, { sidebar: true })) })] }) })), _jsxs("div", { className: "min-w-0", children: [showToolbar && (_jsxs("div", { className: "flex items-center gap-3 mb-4 flex-wrap", children: [_jsxs("div", { className: "relative flex-1 min-w-[220px]", children: [_jsx(Input, { type: "text", className: "w-full bg-card/60 backdrop-blur-md shadow-inner pr-8 h-9 rounded-xl focus-visible:ring-accent border-border/40", placeholder: searchPlaceholder, value: pluginSearch, onChange: (e) => setState("pluginSearch", e.target.value) }), pluginSearch && (_jsx(Button, { variant: "ghost", size: "icon", className: "absolute right-1 top-1/2 -translate-y-1/2 w-6 h-6 text-muted hover:text-txt rounded-full", onClick: () => setState("pluginSearch", ""), title: t("pluginsview.ClearSearch"), children: "\u2715" }))] }), _jsx("div", { className: "flex gap-1.5 shrink-0 bg-black/10 p-1 rounded-xl border border-white/5", children: ["all", "enabled"].map((s) => (_jsx(Button, { variant: pluginStatusFilter === s ? "default" : "ghost", size: "sm", className: `h-7 px-3 text-[11px] font-bold tracking-wide rounded-lg transition-all ${pluginStatusFilter === s
|
|
1434
|
+
? "shadow-sm"
|
|
1435
|
+
: "text-muted hover:text-txt hover:bg-white/5"}`, onClick: () => setState("pluginStatusFilter", s), children: s === "all"
|
|
1436
|
+
? `All (${categoryPlugins.length})`
|
|
1437
|
+
: `Enabled (${enabledCount})` }, s))) }), allowCustomOrder && pluginOrder.length > 0 && (_jsx(Button, { variant: "outline", size: "sm", className: "h-8 px-3 text-[11px] font-bold border-border/40 bg-card/40 backdrop-blur-md shadow-sm rounded-xl shrink-0", onClick: handleResetOrder, title: t("pluginsview.ResetToDefaultSor"), children: t("pluginsview.ResetOrder") })), showPluginManagementActions && (_jsx(Button, { variant: "secondary", size: "sm", className: "h-8 px-4 text-[11px] font-bold tracking-wide border border-accent/30 text-txt bg-accent/10 hover:bg-accent/20 hover:border-accent/50 shadow-sm rounded-xl shrink-0 transition-all", onClick: () => setAddDirOpen(true), children: t("pluginsview.AddPlugin") }))] })), hasPluginToggleInFlight && (_jsx("div", { className: "mb-3 px-3 py-2 border border-accent bg-accent-subtle text-[11px] text-txt", children: t("pluginsview.ApplyingPluginChan") })), showSubgroupFilters && (_jsx("div", { className: "flex items-center gap-2 mb-5 flex-wrap md:hidden", "data-testid": "plugins-subgroup-chips", children: subgroupTags.map((tag) => renderSubgroupFilterButton(tag)) })), _jsx("div", { className: "overflow-y-auto", children: sorted.length === 0 ? (_jsx("div", { className: "text-center py-10 px-5 text-muted border border-dashed border-border", children: effectiveSearch
|
|
1438
|
+
? `No ${resultLabel} match your search.`
|
|
1439
|
+
: `No ${resultLabel} available.` })) : visiblePlugins.length === 0 ? (_jsx("div", { className: "text-center py-10 px-5 text-muted border border-dashed border-border", children: showSubgroupFilters
|
|
1440
|
+
? "No plugins match this tag filter."
|
|
1441
|
+
: `No ${resultLabel} match your filters.` })) : (renderPluginGrid(visiblePlugins)) })] }), settingsDialogPlugin &&
|
|
1442
|
+
(() => {
|
|
1443
|
+
const p = settingsDialogPlugin;
|
|
1444
|
+
const isShowcase = p.id === "__ui-showcase__";
|
|
1445
|
+
const isSaving = pluginSaving.has(p.id);
|
|
1446
|
+
const saveSuccess = pluginSaveSuccess.has(p.id);
|
|
1447
|
+
const categoryLabel = isShowcase
|
|
1448
|
+
? "showcase"
|
|
1449
|
+
: p.category === "ai-provider"
|
|
1450
|
+
? "ai provider"
|
|
1451
|
+
: p.category;
|
|
1452
|
+
return (_jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-6 animate-in fade-in duration-200", onClick: (e) => {
|
|
1453
|
+
if (e.target === e.currentTarget)
|
|
1454
|
+
toggleSettings(p.id);
|
|
1455
|
+
}, onKeyDown: (e) => {
|
|
1456
|
+
if (e.key === "Escape" || e.key === "Enter" || e.key === " ") {
|
|
1457
|
+
e.preventDefault();
|
|
1458
|
+
toggleSettings(p.id);
|
|
1459
|
+
}
|
|
1460
|
+
}, role: "dialog", "aria-modal": "true", children: _jsxs("div", { className: "w-full max-w-2xl max-h-[85vh] border border-border/50 bg-card/90 shadow-2xl flex flex-col overflow-hidden rounded-2xl backdrop-blur-xl", children: [_jsxs("div", { className: "flex items-center gap-3 px-5 py-4 border-b border-border/30 bg-black/10 shrink-0", children: [_jsxs("span", { className: "font-bold text-base flex items-center gap-2 flex-1 min-w-0 tracking-wide text-txt", children: [(() => {
|
|
1461
|
+
const icon = resolveIcon(p);
|
|
1462
|
+
if (!icon)
|
|
1463
|
+
return null;
|
|
1464
|
+
if (typeof icon === "string") {
|
|
1465
|
+
const imageSrc = iconImageSource(icon);
|
|
1466
|
+
return imageSrc ? (_jsx("img", { src: imageSrc, alt: "", className: "w-6 h-6 rounded-md object-contain", onError: (e) => {
|
|
1467
|
+
e.currentTarget.style.display = "none";
|
|
1468
|
+
} })) : (_jsx("span", { className: "text-base", children: icon }));
|
|
1469
|
+
}
|
|
1470
|
+
const IconComponent = icon;
|
|
1471
|
+
return _jsx(IconComponent, { className: "w-6 h-6 text-txt" });
|
|
1472
|
+
})(), p.name] }), _jsx("span", { className: "text-[10px] px-2 py-0.5 rounded-full border border-border/40 bg-black/20 text-muted lowercase tracking-widest font-bold", children: categoryLabel }), p.version && (_jsxs("span", { className: "text-[10px] font-mono text-muted/70", children: ["v", p.version] })), isShowcase && (_jsx("span", { className: "text-[10px] font-bold tracking-widest px-2.5 py-[2px] border border-accent/30 text-txt bg-accent/10 rounded-full", children: t("pluginsview.DEMO") })), _jsx(Button, { variant: "ghost", size: "icon", className: "h-8 w-8 text-muted hover:bg-white/10 hover:text-txt rounded-full transition-all shrink-0 ml-2", onClick: () => toggleSettings(p.id), children: "\u2715" })] }), _jsxs("div", { className: "overflow-y-auto flex-1 scrollbar-thin scrollbar-thumb-white/10 scrollbar-track-transparent", children: [_jsxs("div", { className: "px-5 pt-4 pb-1 flex items-center gap-3 flex-wrap text-xs text-muted", children: [p.description && (_jsx("span", { className: "text-[12px] text-muted leading-relaxed", children: p.description })), (p.tags?.length ?? 0) > 0 && (_jsx("span", { className: "flex items-center gap-1.5 flex-wrap", children: p.tags?.map((tag) => (_jsx("span", { className: "text-[10px] px-1.5 py-px border border-border/40 bg-black/10 text-muted lowercase tracking-wide whitespace-nowrap", children: tag }, `${p.id}:${tag}:settings`))) }))] }), (p.npmName || (p.pluginDeps && p.pluginDeps.length > 0)) && (_jsxs("div", { className: "px-5 pb-2 flex items-center gap-3 flex-wrap", children: [p.npmName && (_jsx("span", { className: "font-mono text-[10px] text-muted opacity-50", children: p.npmName })), p.pluginDeps && p.pluginDeps.length > 0 && (_jsxs("span", { className: "flex items-center gap-1 flex-wrap", children: [_jsx("span", { className: "text-[10px] text-muted opacity-60", children: t("pluginsview.dependsOn") }), p.pluginDeps.map((dep) => (_jsx("span", { className: "text-[10px] px-1.5 py-px border border-border bg-accent-subtle text-muted rounded-sm", children: dep }, dep)))] }))] })), _jsxs("div", { className: "px-5 py-3", children: [_jsx(PluginConfigForm, { plugin: p, pluginConfigs: pluginConfigs, onParamChange: handleParamChange }), p.id === "whatsapp" && (_jsx(WhatsAppQrOverlay, { accountId: "default" }))] })] }), !isShowcase && (_jsxs("div", { className: "flex justify-end gap-3 px-5 py-4 border-t border-border/30 shrink-0 bg-black/10", children: [p.enabled && !p.isActive && p.npmName && !p.loadError && (_jsx(Button, { variant: "default", size: "sm", className: "h-8 px-4 text-[11px] font-bold tracking-wide shadow-sm", disabled: installingPlugins.has(p.id), onClick: () => handleInstallPlugin(p.id, p.npmName ?? ""), children: installingPlugins.has(p.id)
|
|
1473
|
+
? installProgress.get(p.npmName ?? "")?.message ||
|
|
1474
|
+
"Installing..."
|
|
1475
|
+
: "Install Plugin" })), p.loadError && (_jsx("span", { className: "px-3 py-1.5 text-[11px] text-danger font-bold tracking-wide", title: p.loadError, children: t("pluginsview.PackageBrokenMis") })), p.isActive && (_jsx(Button, { variant: testResults.get(p.id)?.success
|
|
1476
|
+
? "default"
|
|
1477
|
+
: testResults.get(p.id)?.error
|
|
1478
|
+
? "destructive"
|
|
1479
|
+
: "outline", size: "sm", className: `h-8 px-4 text-[11px] font-bold tracking-wide transition-all ${testResults.get(p.id)?.loading
|
|
1480
|
+
? "opacity-70 cursor-wait"
|
|
1481
|
+
: testResults.get(p.id)?.success
|
|
1482
|
+
? "bg-ok text-ok-fg border-ok hover:bg-ok/90"
|
|
1483
|
+
: testResults.get(p.id)?.error
|
|
1484
|
+
? "bg-danger text-danger-fg border-danger hover:bg-danger/90"
|
|
1485
|
+
: "border-border/40 bg-card/40 backdrop-blur-md shadow-sm hover:border-accent/40"}`, disabled: testResults.get(p.id)?.loading, onClick: () => handleTestConnection(p.id), children: testResults.get(p.id)?.loading
|
|
1486
|
+
? "Testing..."
|
|
1487
|
+
: testResults.get(p.id)?.success
|
|
1488
|
+
? `\u2713 OK (${testResults.get(p.id)?.durationMs}ms)`
|
|
1489
|
+
: testResults.get(p.id)?.error
|
|
1490
|
+
? `\u2715 ${testResults.get(p.id)?.error}`
|
|
1491
|
+
: "Test Connection" })), _jsx(Button, { variant: "ghost", size: "sm", className: "h-8 px-4 text-[12px] font-bold text-muted hover:text-txt transition-all", onClick: () => handleConfigReset(p.id), children: t("pluginsview.Reset") }), _jsx(Button, { variant: saveSuccess ? "default" : "secondary", size: "sm", className: `h-8 px-5 text-[12px] font-bold tracking-wide transition-all ${saveSuccess
|
|
1492
|
+
? "bg-ok text-ok-fg hover:bg-ok/90"
|
|
1493
|
+
: "bg-accent text-accent-fg hover:bg-accent/90 shadow-lg shadow-accent/20"}`, onClick: () => handleConfigSave(p.id), disabled: isSaving, children: isSaving
|
|
1494
|
+
? "Saving..."
|
|
1495
|
+
: saveSuccess
|
|
1496
|
+
? "\u2713 Saved"
|
|
1497
|
+
: "Save Settings" })] }))] }) }));
|
|
1498
|
+
})(), addDirOpen && (_jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-6 duration-200 animate-in fade-in", onClick: (e) => {
|
|
1499
|
+
if (e.target === e.currentTarget) {
|
|
1500
|
+
setAddDirOpen(false);
|
|
1501
|
+
setAddDirPath("");
|
|
1502
|
+
}
|
|
1503
|
+
}, onKeyDown: (e) => {
|
|
1504
|
+
if (e.key === "Escape" || e.key === "Enter" || e.key === " ") {
|
|
1505
|
+
e.preventDefault();
|
|
1506
|
+
setAddDirOpen(false);
|
|
1507
|
+
setAddDirPath("");
|
|
1508
|
+
}
|
|
1509
|
+
}, role: "dialog", "aria-modal": "true", children: _jsxs("div", { className: "w-full max-w-md border border-border/50 bg-card/90 backdrop-blur-xl p-6 rounded-2xl shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between mb-5", children: [_jsx("div", { className: "font-bold text-base tracking-wide text-txt", children: t("pluginsview.AddPlugin1") }), _jsx(Button, { variant: "ghost", size: "icon", className: "h-8 w-8 text-muted hover:bg-white/10 hover:text-txt rounded-full transition-all shrink-0 ml-2", onClick: () => {
|
|
1510
|
+
setAddDirOpen(false);
|
|
1511
|
+
setAddDirPath("");
|
|
1512
|
+
}, children: "\u2715" })] }), _jsx("p", { className: "text-sm font-medium tracking-wide text-muted mb-4", children: t("pluginsview.EnterThePathToA") }), _jsx(Input, { type: "text", className: "w-full h-10 px-3 border border-border/40 bg-black/20 text-txt text-[13px] font-mono transition-all duration-150 focus-visible:ring-accent rounded-xl shadow-inner placeholder:text-muted/50", placeholder: t("pluginsview.PathToPluginOrP"), value: addDirPath, onChange: (e) => setAddDirPath(e.target.value), onKeyDown: (e) => {
|
|
1513
|
+
if (e.key === "Enter")
|
|
1514
|
+
void handleAddFromDirectory();
|
|
1515
|
+
} }), _jsxs("div", { className: "flex justify-end gap-3 mt-6", children: [_jsx(Button, { variant: "ghost", size: "sm", className: "h-8 px-4 text-[12px] font-bold text-muted hover:text-txt transition-all", onClick: () => {
|
|
1516
|
+
setAddDirOpen(false);
|
|
1517
|
+
setAddDirPath("");
|
|
1518
|
+
}, children: t("pluginsview.Cancel") }), _jsx(Button, { variant: "default", size: "sm", className: "h-8 px-6 text-[12px] font-bold tracking-wide shadow-sm", onClick: handleAddFromDirectory, disabled: addDirLoading || !addDirPath.trim(), children: addDirLoading ? "Adding..." : "Add" })] })] }) }))] }));
|
|
1519
|
+
}
|
|
1520
|
+
/* ── Exported views ────────────────────────────────────────────────── */
|
|
1521
|
+
/** Unified plugins view — tag-filtered plugin list. */
|
|
1522
|
+
export function PluginsView({ mode = "all", inModal, }) {
|
|
1523
|
+
const label = mode === "social"
|
|
1524
|
+
? "Connectors"
|
|
1525
|
+
: mode === "connectors"
|
|
1526
|
+
? "Connectors"
|
|
1527
|
+
: mode === "streaming"
|
|
1528
|
+
? "Streaming"
|
|
1529
|
+
: "Plugins";
|
|
1530
|
+
return _jsx(PluginListView, { label: label, mode: mode, inModal: inModal });
|
|
1531
|
+
}
|