@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,657 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Dialog, DialogContent, DialogHeader, DialogTitle, Input, SectionCard, } from "@elizaos/ui";
|
|
3
|
+
import { AlertCircle, CircleDollarSign, CreditCard, ExternalLink, LayoutDashboard, Loader2, Plus, RefreshCw, Server, Shield, Terminal, Trash2, Wallet, X, Zap, } from "lucide-react";
|
|
4
|
+
import { useCallback, useEffect, useReducer, useRef, useState } from "react";
|
|
5
|
+
import { client, } from "../api";
|
|
6
|
+
import { useApp } from "../state";
|
|
7
|
+
import { openExternalUrl } from "../utils";
|
|
8
|
+
import { StripeEmbeddedCheckout } from "./StripeEmbeddedCheckout";
|
|
9
|
+
const ELIZA_CLOUD_LOGIN_URL = "https://www.elizacloud.ai/login?returnTo=%2Fdashboard%2Fmilady";
|
|
10
|
+
const ELIZA_CLOUD_INSTANCES_URL = "https://www.elizacloud.ai/dashboard/milady";
|
|
11
|
+
const BILLING_PRESET_AMOUNTS = [10, 25, 100];
|
|
12
|
+
const STATUS_BADGE = {
|
|
13
|
+
running: {
|
|
14
|
+
label: "Running",
|
|
15
|
+
className: "bg-ok/10 text-ok border-ok/20",
|
|
16
|
+
},
|
|
17
|
+
queued: {
|
|
18
|
+
label: "Queued",
|
|
19
|
+
className: "bg-warn/10 text-warn border-warn/20",
|
|
20
|
+
},
|
|
21
|
+
provisioning: {
|
|
22
|
+
label: "Provisioning",
|
|
23
|
+
className: "bg-accent/10 text-txt border-accent/20",
|
|
24
|
+
},
|
|
25
|
+
stopped: {
|
|
26
|
+
label: "Stopped",
|
|
27
|
+
className: "bg-muted/10 text-muted border-border/40",
|
|
28
|
+
},
|
|
29
|
+
failed: {
|
|
30
|
+
label: "Failed",
|
|
31
|
+
className: "bg-danger/10 text-danger border-danger/20",
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
function AgentStatusBadge({ status }) {
|
|
35
|
+
const badge = STATUS_BADGE[status] ?? STATUS_BADGE.stopped;
|
|
36
|
+
return (_jsx("span", { className: `text-[10px] px-2 py-0.5 rounded-full font-bold uppercase tracking-wider border ${badge?.className}`, children: badge?.label }));
|
|
37
|
+
}
|
|
38
|
+
function CloudAgentCard({ agent, onDelete, deleting, launching, onLaunch, onSelect, }) {
|
|
39
|
+
return (
|
|
40
|
+
// biome-ignore lint/a11y/useSemanticElements: cannot use button due to nested buttons
|
|
41
|
+
_jsxs("div", { className: "rounded-2xl border border-border/50 bg-bg/30 p-4 flex flex-col justify-between gap-3 hover:border-accent/30 transition-all duration-200 cursor-pointer", onClick: () => onSelect?.(agent.agent_id), onKeyDown: (e) => {
|
|
42
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
onSelect?.(agent.agent_id);
|
|
45
|
+
}
|
|
46
|
+
}, role: "button", tabIndex: 0, children: [_jsxs("div", { className: "flex items-start justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Server, { className: "w-4 h-4 text-txt shrink-0" }), _jsx("span", { className: "font-bold text-sm text-txt-strong truncate max-w-[140px]", children: agent.agent_name || "Unnamed Agent" })] }), _jsx(AgentStatusBadge, { status: agent.status })] }), _jsxs("div", { className: "text-[11px] text-muted space-y-1", children: [_jsxs("div", { className: "flex justify-between", children: [_jsx("span", { children: "Node" }), _jsx("span", { className: "font-mono text-txt-strong/70", children: agent.node_id?.slice(0, 8) ?? "—" })] }), _jsxs("div", { className: "flex justify-between", children: [_jsx("span", { children: "Created" }), _jsx("span", { className: "text-txt-strong/70", children: new Date(agent.created_at).toLocaleDateString() })] })] }), _jsxs("div", { className: "flex gap-2 mt-1", children: [_jsxs(Button, { variant: "outline", size: "sm", className: "flex-1 rounded-xl h-8 text-xs border-border/40", onClick: (event) => {
|
|
47
|
+
event.stopPropagation();
|
|
48
|
+
onLaunch(agent.agent_id);
|
|
49
|
+
}, disabled: launching, children: [launching ? (_jsx(Loader2, { className: "w-3 h-3 mr-1 animate-spin" })) : (_jsx(ExternalLink, { className: "w-3 h-3 mr-1" })), "Open"] }), _jsx(Button, { variant: "outline", size: "sm", className: "settings-icon-button rounded-xl h-8 text-xs border-danger/30 text-danger hover:bg-danger/10", onClick: (event) => {
|
|
50
|
+
event.stopPropagation();
|
|
51
|
+
onDelete(agent.agent_id);
|
|
52
|
+
}, disabled: deleting || launching, children: deleting ? (_jsx(Loader2, { className: "w-3 h-3 animate-spin" })) : (_jsx(Trash2, { className: "w-3 h-3" })) })] })] }));
|
|
53
|
+
}
|
|
54
|
+
function isRecord(value) {
|
|
55
|
+
return typeof value === "object" && value !== null;
|
|
56
|
+
}
|
|
57
|
+
function unwrapBillingData(value) {
|
|
58
|
+
if (isRecord(value.data)) {
|
|
59
|
+
return value.data;
|
|
60
|
+
}
|
|
61
|
+
return value;
|
|
62
|
+
}
|
|
63
|
+
function readString(value) {
|
|
64
|
+
return typeof value === "string" && value.trim() ? value : undefined;
|
|
65
|
+
}
|
|
66
|
+
function readNumber(value) {
|
|
67
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
68
|
+
return value;
|
|
69
|
+
if (typeof value === "string" && value.trim()) {
|
|
70
|
+
const parsed = Number(value);
|
|
71
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
function readBoolean(value) {
|
|
76
|
+
return typeof value === "boolean" ? value : undefined;
|
|
77
|
+
}
|
|
78
|
+
function normalizeBillingSummary(raw) {
|
|
79
|
+
const source = unwrapBillingData(raw);
|
|
80
|
+
return {
|
|
81
|
+
...raw,
|
|
82
|
+
...source,
|
|
83
|
+
balance: readNumber(source.balance) ??
|
|
84
|
+
readNumber(source.creditBalance) ??
|
|
85
|
+
null,
|
|
86
|
+
currency: readString(source.currency) ??
|
|
87
|
+
readString(source.balanceCurrency),
|
|
88
|
+
topUpUrl: readString(source.topUpUrl) ??
|
|
89
|
+
readString(source.billingUrl),
|
|
90
|
+
embeddedCheckoutEnabled: readBoolean(source.embeddedCheckoutEnabled) ??
|
|
91
|
+
readBoolean(source.embedded),
|
|
92
|
+
hostedCheckoutEnabled: readBoolean(source.hostedCheckoutEnabled) ??
|
|
93
|
+
readBoolean(source.hosted),
|
|
94
|
+
cryptoEnabled: readBoolean(source.cryptoEnabled) ??
|
|
95
|
+
readBoolean(source.crypto),
|
|
96
|
+
low: readBoolean(source.low),
|
|
97
|
+
critical: readBoolean(source.critical),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function normalizeBillingSettings(raw) {
|
|
101
|
+
const source = unwrapBillingData(raw);
|
|
102
|
+
return {
|
|
103
|
+
...raw,
|
|
104
|
+
...source,
|
|
105
|
+
settings: isRecord(source.settings) ? source.settings : raw.settings,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function getBillingAutoTopUp(settings) {
|
|
109
|
+
const rawSettings = isRecord(settings?.settings) ? settings.settings : null;
|
|
110
|
+
return isRecord(rawSettings?.autoTopUp) ? rawSettings.autoTopUp : {};
|
|
111
|
+
}
|
|
112
|
+
function getBillingLimits(settings) {
|
|
113
|
+
const rawSettings = isRecord(settings?.settings) ? settings.settings : null;
|
|
114
|
+
return isRecord(rawSettings?.limits) ? rawSettings.limits : {};
|
|
115
|
+
}
|
|
116
|
+
function resolveCheckoutUrl(response) {
|
|
117
|
+
return (readString(response.checkoutUrl) ??
|
|
118
|
+
readString(response.url) ??
|
|
119
|
+
readString(response.hostedUrl) ??
|
|
120
|
+
null);
|
|
121
|
+
}
|
|
122
|
+
function buildAutoTopUpFormState(billingSummary, billingSettings) {
|
|
123
|
+
const autoTopUp = getBillingAutoTopUp(billingSettings);
|
|
124
|
+
const minimumTopUp = readNumber(billingSummary?.minimumTopUp) ?? 1;
|
|
125
|
+
const enabled = readBoolean(autoTopUp.enabled) ?? false;
|
|
126
|
+
const amount = String(readNumber(autoTopUp.amount) ?? minimumTopUp);
|
|
127
|
+
const threshold = String(readNumber(autoTopUp.threshold) ?? 5);
|
|
128
|
+
return {
|
|
129
|
+
amount,
|
|
130
|
+
dirty: false,
|
|
131
|
+
enabled,
|
|
132
|
+
sourceKey: JSON.stringify([enabled, amount, threshold]),
|
|
133
|
+
threshold,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function autoTopUpFormReducer(state, action) {
|
|
137
|
+
switch (action.type) {
|
|
138
|
+
case "hydrate":
|
|
139
|
+
if (!action.force && state.dirty) {
|
|
140
|
+
return state;
|
|
141
|
+
}
|
|
142
|
+
if (state.sourceKey === action.next.sourceKey && !state.dirty) {
|
|
143
|
+
return state;
|
|
144
|
+
}
|
|
145
|
+
return action.next;
|
|
146
|
+
case "setAmount":
|
|
147
|
+
return { ...state, amount: action.value, dirty: true };
|
|
148
|
+
case "setEnabled":
|
|
149
|
+
return { ...state, enabled: action.value, dirty: true };
|
|
150
|
+
case "setThreshold":
|
|
151
|
+
return { ...state, threshold: action.value, dirty: true };
|
|
152
|
+
default:
|
|
153
|
+
return state;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
export function CloudDashboard() {
|
|
157
|
+
const { t, elizaCloudConnected, elizaCloudCredits, elizaCloudCreditsLow, elizaCloudCreditsCritical, elizaCloudTopUpUrl, elizaCloudUserId, cloudDashboardView, elizaCloudLoginBusy, handleCloudLogin, handleCloudDisconnect, elizaCloudDisconnecting: cloudDisconnecting, loadDropStatus, walletAddresses, walletBalances, retryStartup, setActionNotice, setState, setTab, } = useApp();
|
|
158
|
+
const [refreshing, setRefreshing] = useState(false);
|
|
159
|
+
const [billingLoading, setBillingLoading] = useState(false);
|
|
160
|
+
const [billingError, setBillingError] = useState(null);
|
|
161
|
+
const [billingSummary, setBillingSummary] = useState(null);
|
|
162
|
+
const [billingSettings, setBillingSettings] = useState(null);
|
|
163
|
+
const [billingAmount, setBillingAmount] = useState("25");
|
|
164
|
+
const [autoTopUpForm, dispatchAutoTopUpForm] = useReducer(autoTopUpFormReducer, buildAutoTopUpFormState(null, null));
|
|
165
|
+
const [billingSettingsBusy, setBillingSettingsBusy] = useState(false);
|
|
166
|
+
const [checkoutBusy, setCheckoutBusy] = useState(false);
|
|
167
|
+
const [checkoutSession, setCheckoutSession] = useState(null);
|
|
168
|
+
const [checkoutDialogOpen, setCheckoutDialogOpen] = useState(false);
|
|
169
|
+
const [cryptoBusy, setCryptoBusy] = useState(false);
|
|
170
|
+
const [cryptoQuote, setCryptoQuote] = useState(null);
|
|
171
|
+
const [cryptoPayBusy, setCryptoPayBusy] = useState(false);
|
|
172
|
+
const [cryptoPayResult, setCryptoPayResult] = useState(null);
|
|
173
|
+
const [cloudAgents, setCloudAgents] = useState([]);
|
|
174
|
+
const [agentsLoading, setAgentsLoading] = useState(false);
|
|
175
|
+
const [agentsError, setAgentsError] = useState(null);
|
|
176
|
+
const [deletingAgentId, setDeletingAgentId] = useState(null);
|
|
177
|
+
const [launchingAgentId, setLaunchingAgentId] = useState(null);
|
|
178
|
+
const [selectedAgentId, setSelectedAgentId] = useState(null);
|
|
179
|
+
const selectedAgent = cloudAgents.find((a) => a.agent_id === selectedAgentId);
|
|
180
|
+
const [showDeployForm, setShowDeployForm] = useState(false);
|
|
181
|
+
const [deployAgentName, setDeployAgentName] = useState("");
|
|
182
|
+
const [deploying, setDeploying] = useState(false);
|
|
183
|
+
const mountedRef = useRef(true);
|
|
184
|
+
const autoTopUpEnabled = autoTopUpForm.enabled;
|
|
185
|
+
const autoTopUpAmount = autoTopUpForm.amount;
|
|
186
|
+
const autoTopUpThreshold = autoTopUpForm.threshold;
|
|
187
|
+
const fetchCloudAgents = useCallback(async () => {
|
|
188
|
+
setAgentsLoading(true);
|
|
189
|
+
setAgentsError(null);
|
|
190
|
+
try {
|
|
191
|
+
const data = await client.getCloudCompatAgents();
|
|
192
|
+
if (!mountedRef.current)
|
|
193
|
+
return;
|
|
194
|
+
setCloudAgents(Array.isArray(data.data) ? data.data : []);
|
|
195
|
+
}
|
|
196
|
+
catch (err) {
|
|
197
|
+
if (!mountedRef.current)
|
|
198
|
+
return;
|
|
199
|
+
setAgentsError(err instanceof Error ? err.message : "Failed to load cloud agents");
|
|
200
|
+
setCloudAgents([]);
|
|
201
|
+
}
|
|
202
|
+
finally {
|
|
203
|
+
if (mountedRef.current)
|
|
204
|
+
setAgentsLoading(false);
|
|
205
|
+
}
|
|
206
|
+
}, []);
|
|
207
|
+
const fetchBillingData = useCallback(async () => {
|
|
208
|
+
setBillingLoading(true);
|
|
209
|
+
setBillingError(null);
|
|
210
|
+
try {
|
|
211
|
+
const [summaryResponse, settingsResponse] = await Promise.all([
|
|
212
|
+
client.getCloudBillingSummary().catch((err) => ({ __error: err })),
|
|
213
|
+
client.getCloudBillingSettings().catch((err) => ({
|
|
214
|
+
__error: err,
|
|
215
|
+
})),
|
|
216
|
+
]);
|
|
217
|
+
if (!mountedRef.current)
|
|
218
|
+
return;
|
|
219
|
+
if (isRecord(summaryResponse) && "__error" in summaryResponse) {
|
|
220
|
+
const err = summaryResponse.__error;
|
|
221
|
+
throw err instanceof Error
|
|
222
|
+
? err
|
|
223
|
+
: new Error("Billing summary unavailable.");
|
|
224
|
+
}
|
|
225
|
+
setBillingSummary(normalizeBillingSummary(summaryResponse));
|
|
226
|
+
if (isRecord(settingsResponse) && !("__error" in settingsResponse)) {
|
|
227
|
+
setBillingSettings(normalizeBillingSettings(settingsResponse));
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
setBillingSettings(null);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
catch (err) {
|
|
234
|
+
if (!mountedRef.current)
|
|
235
|
+
return;
|
|
236
|
+
setBillingSummary(null);
|
|
237
|
+
setBillingSettings(null);
|
|
238
|
+
setBillingError(err instanceof Error ? err.message : "Failed to load billing data.");
|
|
239
|
+
}
|
|
240
|
+
finally {
|
|
241
|
+
if (mountedRef.current) {
|
|
242
|
+
setBillingLoading(false);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}, []);
|
|
246
|
+
useEffect(() => {
|
|
247
|
+
dispatchAutoTopUpForm({
|
|
248
|
+
type: "hydrate",
|
|
249
|
+
next: buildAutoTopUpFormState(billingSummary, billingSettings),
|
|
250
|
+
});
|
|
251
|
+
}, [billingSettings, billingSummary]);
|
|
252
|
+
const handleDeleteAgent = useCallback(async (agentId) => {
|
|
253
|
+
setDeletingAgentId(agentId);
|
|
254
|
+
try {
|
|
255
|
+
const data = await client.deleteCloudCompatAgent(agentId);
|
|
256
|
+
if (data.success) {
|
|
257
|
+
setCloudAgents((prev) => prev.filter((a) => a.agent_id !== agentId));
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
// Silently fail — user can retry
|
|
262
|
+
}
|
|
263
|
+
finally {
|
|
264
|
+
setDeletingAgentId(null);
|
|
265
|
+
if (selectedAgentId === agentId)
|
|
266
|
+
setSelectedAgentId(null);
|
|
267
|
+
}
|
|
268
|
+
}, [selectedAgentId]);
|
|
269
|
+
const handleDeployAgent = useCallback(async () => {
|
|
270
|
+
if (!deployAgentName.trim())
|
|
271
|
+
return;
|
|
272
|
+
setDeploying(true);
|
|
273
|
+
try {
|
|
274
|
+
const response = await client.createCloudCompatAgent({
|
|
275
|
+
agentName: deployAgentName.trim(),
|
|
276
|
+
});
|
|
277
|
+
if (response.success) {
|
|
278
|
+
await fetchCloudAgents();
|
|
279
|
+
setShowDeployForm(false);
|
|
280
|
+
setDeployAgentName("");
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
catch {
|
|
284
|
+
// Intentionally swallow for now
|
|
285
|
+
}
|
|
286
|
+
finally {
|
|
287
|
+
setDeploying(false);
|
|
288
|
+
}
|
|
289
|
+
}, [deployAgentName, fetchCloudAgents]);
|
|
290
|
+
const handleLaunchAgent = useCallback(async (agentId) => {
|
|
291
|
+
setLaunchingAgentId(agentId);
|
|
292
|
+
try {
|
|
293
|
+
const response = await client.launchCloudCompatAgent(agentId);
|
|
294
|
+
if (!response.success || !response.data?.connection?.apiBase) {
|
|
295
|
+
throw new Error("Eliza Cloud did not return a launch connection.");
|
|
296
|
+
}
|
|
297
|
+
const { connection } = response.data;
|
|
298
|
+
client.setBaseUrl(connection.apiBase);
|
|
299
|
+
client.setToken(connection.token);
|
|
300
|
+
setState("startupError", null);
|
|
301
|
+
setState("onboardingRunMode", "cloud");
|
|
302
|
+
setState("onboardingCloudProvider", "elizacloud");
|
|
303
|
+
setState("onboardingRemoteApiBase", connection.apiBase);
|
|
304
|
+
setState("onboardingRemoteToken", connection.token);
|
|
305
|
+
setState("onboardingRemoteError", null);
|
|
306
|
+
setState("onboardingRemoteConnecting", false);
|
|
307
|
+
setState("onboardingRemoteConnected", false);
|
|
308
|
+
setActionNotice("Opened managed Eliza Cloud instance.", "success", 3000);
|
|
309
|
+
setTab("chat");
|
|
310
|
+
retryStartup();
|
|
311
|
+
}
|
|
312
|
+
catch (err) {
|
|
313
|
+
setActionNotice(err instanceof Error
|
|
314
|
+
? err.message
|
|
315
|
+
: "Failed to open Eliza Cloud instance.", "error", 4200);
|
|
316
|
+
}
|
|
317
|
+
finally {
|
|
318
|
+
if (mountedRef.current) {
|
|
319
|
+
setLaunchingAgentId(null);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}, [retryStartup, setActionNotice, setState, setTab]);
|
|
323
|
+
const handleRefresh = useCallback(async () => {
|
|
324
|
+
setRefreshing(true);
|
|
325
|
+
await Promise.all([
|
|
326
|
+
loadDropStatus(),
|
|
327
|
+
fetchCloudAgents(),
|
|
328
|
+
fetchBillingData(),
|
|
329
|
+
]);
|
|
330
|
+
setTimeout(() => setRefreshing(false), 600);
|
|
331
|
+
}, [fetchBillingData, fetchCloudAgents, loadDropStatus]);
|
|
332
|
+
const handleSaveBillingSettings = useCallback(async () => {
|
|
333
|
+
const limits = getBillingLimits(billingSettings);
|
|
334
|
+
const amount = Number(autoTopUpAmount);
|
|
335
|
+
const threshold = Number(autoTopUpThreshold);
|
|
336
|
+
const minAmount = readNumber(limits.minAmount) ?? 1;
|
|
337
|
+
const maxAmount = readNumber(limits.maxAmount) ?? 1000;
|
|
338
|
+
const minThreshold = readNumber(limits.minThreshold) ?? 0;
|
|
339
|
+
const maxThreshold = readNumber(limits.maxThreshold) ?? 1000;
|
|
340
|
+
const hasPaymentMethod = readBoolean(getBillingAutoTopUp(billingSettings).hasPaymentMethod) ??
|
|
341
|
+
readBoolean(billingSummary?.hasPaymentMethod) ??
|
|
342
|
+
false;
|
|
343
|
+
if (!Number.isFinite(amount) || amount < minAmount || amount > maxAmount) {
|
|
344
|
+
setActionNotice(`Auto top-up amount must be between $${minAmount} and $${maxAmount}.`, "error", 3600);
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
if (!Number.isFinite(threshold) ||
|
|
348
|
+
threshold < minThreshold ||
|
|
349
|
+
threshold > maxThreshold) {
|
|
350
|
+
setActionNotice(`Auto top-up threshold must be between $${minThreshold} and $${maxThreshold}.`, "error", 3600);
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
if (autoTopUpEnabled && !hasPaymentMethod) {
|
|
354
|
+
setActionNotice("Save a payment method through card checkout before enabling auto top-up.", "info", 4200);
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
setBillingSettingsBusy(true);
|
|
358
|
+
try {
|
|
359
|
+
const response = await client.updateCloudBillingSettings({
|
|
360
|
+
autoTopUp: {
|
|
361
|
+
enabled: autoTopUpEnabled,
|
|
362
|
+
amount,
|
|
363
|
+
threshold,
|
|
364
|
+
},
|
|
365
|
+
});
|
|
366
|
+
if (!mountedRef.current)
|
|
367
|
+
return;
|
|
368
|
+
const normalizedSettings = normalizeBillingSettings(response);
|
|
369
|
+
setBillingSettings(normalizedSettings);
|
|
370
|
+
dispatchAutoTopUpForm({
|
|
371
|
+
type: "hydrate",
|
|
372
|
+
next: buildAutoTopUpFormState(billingSummary, normalizedSettings),
|
|
373
|
+
force: true,
|
|
374
|
+
});
|
|
375
|
+
await fetchBillingData();
|
|
376
|
+
setActionNotice("Billing settings updated.", "success", 3200);
|
|
377
|
+
}
|
|
378
|
+
catch (err) {
|
|
379
|
+
setActionNotice(err instanceof Error
|
|
380
|
+
? err.message
|
|
381
|
+
: "Failed to update billing settings.", "error", 4200);
|
|
382
|
+
}
|
|
383
|
+
finally {
|
|
384
|
+
if (mountedRef.current) {
|
|
385
|
+
setBillingSettingsBusy(false);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}, [
|
|
389
|
+
autoTopUpAmount,
|
|
390
|
+
autoTopUpEnabled,
|
|
391
|
+
autoTopUpThreshold,
|
|
392
|
+
billingSettings,
|
|
393
|
+
billingSummary,
|
|
394
|
+
fetchBillingData,
|
|
395
|
+
setActionNotice,
|
|
396
|
+
]);
|
|
397
|
+
const handleStartCheckout = useCallback(async () => {
|
|
398
|
+
const minimumTopUp = readNumber(billingSummary?.minimumTopUp) ?? 1;
|
|
399
|
+
const amountUsd = Number(billingAmount);
|
|
400
|
+
if (!Number.isFinite(amountUsd) || amountUsd < minimumTopUp) {
|
|
401
|
+
setActionNotice(`Enter a top-up amount of at least $${minimumTopUp}.`, "error", 3200);
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
setCheckoutBusy(true);
|
|
405
|
+
try {
|
|
406
|
+
const response = await client.createCloudBillingCheckout({
|
|
407
|
+
amountUsd,
|
|
408
|
+
mode: billingSummary?.embeddedCheckoutEnabled ? "embedded" : "hosted",
|
|
409
|
+
});
|
|
410
|
+
const clientSecret = readString(response.clientSecret);
|
|
411
|
+
const publishableKey = readString(response.publishableKey);
|
|
412
|
+
if (clientSecret && publishableKey) {
|
|
413
|
+
setCheckoutSession(response);
|
|
414
|
+
setCheckoutDialogOpen(true);
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
const checkoutUrl = resolveCheckoutUrl(response);
|
|
418
|
+
if (checkoutUrl) {
|
|
419
|
+
await openExternalUrl(checkoutUrl);
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
throw new Error(readString(response.message) ??
|
|
423
|
+
"Eliza Cloud did not return a checkout session.");
|
|
424
|
+
}
|
|
425
|
+
catch (err) {
|
|
426
|
+
setActionNotice(err instanceof Error ? err.message : "Failed to start checkout.", "error", 4200);
|
|
427
|
+
}
|
|
428
|
+
finally {
|
|
429
|
+
setCheckoutBusy(false);
|
|
430
|
+
}
|
|
431
|
+
}, [billingAmount, billingSummary, setActionNotice]);
|
|
432
|
+
const handleCreateCryptoQuote = useCallback(async () => {
|
|
433
|
+
const minimumTopUp = readNumber(billingSummary?.minimumTopUp) ?? 1;
|
|
434
|
+
const amountUsd = Number(billingAmount);
|
|
435
|
+
if (!Number.isFinite(amountUsd) || amountUsd < minimumTopUp) {
|
|
436
|
+
setActionNotice(`Enter a top-up amount of at least $${minimumTopUp}.`, "error", 3200);
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
setCryptoBusy(true);
|
|
440
|
+
setCryptoPayResult(null);
|
|
441
|
+
try {
|
|
442
|
+
const response = await client.createCloudBillingCryptoQuote({
|
|
443
|
+
amountUsd,
|
|
444
|
+
walletAddress: walletAddresses?.evmAddress ??
|
|
445
|
+
walletAddresses?.solanaAddress ??
|
|
446
|
+
undefined,
|
|
447
|
+
});
|
|
448
|
+
setCryptoQuote(response);
|
|
449
|
+
}
|
|
450
|
+
catch (err) {
|
|
451
|
+
setCryptoQuote(null);
|
|
452
|
+
setActionNotice(err instanceof Error ? err.message : "Failed to request crypto quote.", "error", 4200);
|
|
453
|
+
}
|
|
454
|
+
finally {
|
|
455
|
+
setCryptoBusy(false);
|
|
456
|
+
}
|
|
457
|
+
}, [billingAmount, billingSummary, setActionNotice, walletAddresses]);
|
|
458
|
+
const handlePayCryptoFromAgentWallet = useCallback(async () => {
|
|
459
|
+
if (!cryptoQuote)
|
|
460
|
+
return;
|
|
461
|
+
const network = readString(cryptoQuote.network)?.toLowerCase();
|
|
462
|
+
const payToAddress = readString(cryptoQuote.payToAddress) ??
|
|
463
|
+
readString(cryptoQuote.address);
|
|
464
|
+
const amount = readString(cryptoQuote.amount);
|
|
465
|
+
const currency = readString(cryptoQuote.currency) ?? "USDC";
|
|
466
|
+
const tokenAddress = readString(cryptoQuote.tokenAddress);
|
|
467
|
+
if (!network || network !== "bsc") {
|
|
468
|
+
setActionNotice("Agent-wallet payment is currently wired for BSC quotes only.", "info", 4200);
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
if (!payToAddress || !amount) {
|
|
472
|
+
setActionNotice("Crypto quote is missing transfer details.", "error", 4200);
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
setCryptoPayBusy(true);
|
|
476
|
+
try {
|
|
477
|
+
const result = await client.executeBscTransfer({
|
|
478
|
+
toAddress: payToAddress,
|
|
479
|
+
amount,
|
|
480
|
+
assetSymbol: currency,
|
|
481
|
+
tokenAddress: tokenAddress ?? undefined,
|
|
482
|
+
confirm: true,
|
|
483
|
+
});
|
|
484
|
+
if (result.executed && result.execution?.hash) {
|
|
485
|
+
setCryptoPayResult(`Submitted ${currency} payment: ${result.execution.hash}`);
|
|
486
|
+
setActionNotice("Crypto payment submitted from the agent wallet.", "success");
|
|
487
|
+
}
|
|
488
|
+
else if (result.requiresUserSignature) {
|
|
489
|
+
setCryptoPayResult("Cloud returned an unsigned payment request. Sign it from the wallet flow to complete payment.");
|
|
490
|
+
setActionNotice("This wallet requires user-sign mode for crypto payment.", "info", 4200);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
catch (err) {
|
|
494
|
+
setCryptoPayResult(null);
|
|
495
|
+
setActionNotice(err instanceof Error ? err.message : "Crypto payment failed.", "error", 4200);
|
|
496
|
+
}
|
|
497
|
+
finally {
|
|
498
|
+
setCryptoPayBusy(false);
|
|
499
|
+
}
|
|
500
|
+
}, [cryptoQuote, setActionNotice]);
|
|
501
|
+
useEffect(() => {
|
|
502
|
+
mountedRef.current = true;
|
|
503
|
+
return () => {
|
|
504
|
+
mountedRef.current = false;
|
|
505
|
+
};
|
|
506
|
+
}, []);
|
|
507
|
+
useEffect(() => {
|
|
508
|
+
if (elizaCloudConnected) {
|
|
509
|
+
void loadDropStatus();
|
|
510
|
+
void fetchCloudAgents();
|
|
511
|
+
void fetchBillingData();
|
|
512
|
+
}
|
|
513
|
+
}, [fetchBillingData, fetchCloudAgents, loadDropStatus, elizaCloudConnected]);
|
|
514
|
+
const summaryCritical = billingSummary?.critical ?? elizaCloudCreditsCritical ?? false;
|
|
515
|
+
const summaryLow = billingSummary?.low ?? elizaCloudCreditsLow ?? false;
|
|
516
|
+
const creditStatusColor = summaryCritical
|
|
517
|
+
? "text-danger"
|
|
518
|
+
: summaryLow
|
|
519
|
+
? "text-warn"
|
|
520
|
+
: "text-ok";
|
|
521
|
+
const activeView = cloudDashboardView;
|
|
522
|
+
const cloudBalance = billingSummary?.balance ?? elizaCloudCredits ?? 0;
|
|
523
|
+
const cloudCurrency = billingSummary?.currency ?? "USD";
|
|
524
|
+
const fallbackBillingUrl = billingSummary?.topUpUrl ?? elizaCloudTopUpUrl ?? null;
|
|
525
|
+
const minimumTopUp = readNumber(billingSummary?.minimumTopUp) ?? 1;
|
|
526
|
+
const billingAutoTopUp = getBillingAutoTopUp(billingSettings);
|
|
527
|
+
const billingLimits = getBillingLimits(billingSettings);
|
|
528
|
+
const autoTopUpHasPaymentMethod = readBoolean(billingAutoTopUp.hasPaymentMethod) ??
|
|
529
|
+
readBoolean(billingSummary?.hasPaymentMethod) ??
|
|
530
|
+
false;
|
|
531
|
+
const autoTopUpMinAmount = readNumber(billingLimits.minAmount) ?? minimumTopUp;
|
|
532
|
+
const autoTopUpMaxAmount = readNumber(billingLimits.maxAmount) ?? 1000;
|
|
533
|
+
const autoTopUpMinThreshold = readNumber(billingLimits.minThreshold) ?? 0;
|
|
534
|
+
const autoTopUpMaxThreshold = readNumber(billingLimits.maxThreshold) ?? 1000;
|
|
535
|
+
const creditStatusTone = summaryCritical
|
|
536
|
+
? t("elizaclouddashboard.CreditsCritical")
|
|
537
|
+
: summaryLow
|
|
538
|
+
? t("elizaclouddashboard.CreditsLow")
|
|
539
|
+
: t("elizaclouddashboard.CreditsHealthy");
|
|
540
|
+
const hasAgentWallet = Boolean(walletAddresses?.evmAddress || walletAddresses?.solanaAddress);
|
|
541
|
+
const hasWalletFunds = Boolean(walletBalances?.evm?.chains.some((chain) => Number(chain.nativeBalance) > 0 ||
|
|
542
|
+
chain.tokens.some((token) => Number(token.balance) > 0)) ||
|
|
543
|
+
((walletBalances?.solana &&
|
|
544
|
+
(Number(walletBalances.solana.solBalance) > 0 ||
|
|
545
|
+
walletBalances.solana.tokens.some((token) => Number(token.balance) > 0))) ??
|
|
546
|
+
false));
|
|
547
|
+
if (!elizaCloudConnected) {
|
|
548
|
+
return (_jsxs("div", { className: "flex flex-col items-center justify-center max-w-md mx-auto px-4 py-8 text-center animate-in fade-in slide-in-from-bottom-4 duration-700", children: [_jsx("div", { className: "w-12 h-12 rounded-2xl bg-accent/10 flex items-center justify-center mb-5 border border-accent/20", children: _jsx(Zap, { className: "w-6 h-6 text-txt" }) }), _jsx("p", { className: "text-sm text-muted mb-6 leading-relaxed", children: t("elizaclouddashboard.ScaleYourAgents") }), _jsxs(Button, { variant: "default", size: "sm", className: "rounded-xl px-8 py-3 text-sm font-semibold shadow-md shadow-accent/15 hover:shadow-accent/30 hover:-translate-y-0.5 transition-all duration-300", onClick: handleCloudLogin, disabled: elizaCloudLoginBusy, children: [elizaCloudLoginBusy ? (_jsx(RefreshCw, { className: "w-4 h-4 mr-2 animate-spin" })) : (_jsx(Zap, { className: "w-4 h-4 mr-2" })), elizaCloudLoginBusy
|
|
549
|
+
? t("elizaclouddashboard.Connecting")
|
|
550
|
+
: t("elizaclouddashboard.ConnectElizaCloud")] }), _jsxs("p", { className: "mt-4 text-xs text-muted/60", children: [t("elizaclouddashboard.NewToElizaCloud"), " ", _jsx("a", { href: ELIZA_CLOUD_LOGIN_URL, target: "_blank", rel: "noopener noreferrer", className: "text-txt underline hover:text-txt-hover transition-colors", children: t("elizaclouddashboard.LearnMore") })] })] }));
|
|
551
|
+
}
|
|
552
|
+
return (_jsxs("div", { className: "custom-scrollbar p-6 lg:p-10 space-y-8 max-w-7xl mx-auto animate-in fade-in duration-500", children: [_jsxs("div", { className: "flex flex-col md:flex-row md:items-end justify-between gap-6", children: [_jsxs("div", { children: [_jsxs("div", { className: "flex items-center gap-3 mb-2", children: [_jsx("div", { className: "w-10 h-10 rounded-xl bg-accent flex items-center justify-center shadow-lg shadow-accent/20", children: _jsx(LayoutDashboard, { className: "w-5 h-5 text-accent-fg" }) }), _jsx("h1", { className: "text-3xl font-bold text-txt-strong tracking-tight", children: t("elizaclouddashboard.CloudDashboard") })] }), _jsx("p", { className: "text-muted", children: t("elizaclouddashboard.ManageInstance") })] }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("div", { className: "inline-flex items-center gap-1 rounded-2xl border border-border/50 bg-bg/50 p-1", children: [_jsxs("button", { type: "button", className: `inline-flex items-center gap-2 rounded-xl px-3 py-2 text-sm font-medium transition-colors ${activeView === "billing"
|
|
553
|
+
? "bg-accent text-accent-fg"
|
|
554
|
+
: "text-muted hover:text-txt"}`, onClick: () => setState("cloudDashboardView", "billing"), children: [_jsx(CircleDollarSign, { className: "w-4 h-4" }), t("elizaclouddashboard.CloudBilling")] }), _jsxs("button", { type: "button", className: `inline-flex items-center gap-2 rounded-xl px-3 py-2 text-sm font-medium transition-colors ${activeView === "agents"
|
|
555
|
+
? "bg-accent text-accent-fg"
|
|
556
|
+
: "text-muted hover:text-txt"}`, onClick: () => setState("cloudDashboardView", "agents"), children: [_jsx(Server, { className: "w-4 h-4" }), t("elizaclouddashboard.CloudAgents")] })] }), _jsxs(Button, { variant: "outline", size: "sm", className: "rounded-xl border-border/50 bg-bg/50 backdrop-blur-sm", onClick: handleRefresh, disabled: refreshing, children: [_jsx(RefreshCw, { className: `w-4 h-4 mr-2 ${refreshing ? "animate-spin" : ""}` }), t("elizaclouddashboard.Refresh")] }), _jsx(Button, { variant: "outline", size: "sm", className: "rounded-xl border-danger/30 text-danger hover:bg-danger/10", onClick: handleCloudDisconnect, disabled: cloudDisconnecting, children: cloudDisconnecting
|
|
557
|
+
? t("elizaclouddashboard.Disconnecting")
|
|
558
|
+
: t("elizaclouddashboard.Disconnect") })] })] }), activeView === "billing" ? (_jsxs("div", { className: "grid grid-cols-1 xl:grid-cols-[minmax(0,1.8fr)_minmax(320px,1fr)] gap-8", children: [_jsx("div", { className: "space-y-8", children: _jsxs(SectionCard, { title: t("elizaclouddashboard.CloudBilling"), description: t("elizaclouddashboard.CloudBillingDesc"), className: "border-border/50 bg-bg/40 backdrop-blur-xl rounded-3xl shadow-sm", children: [billingError && (_jsx("div", { className: "mt-4 rounded-2xl border border-danger/30 bg-danger/10 px-4 py-3 text-sm text-danger", children: billingError })), _jsxs("div", { className: "mt-4 grid grid-cols-1 gap-4 xl:grid-cols-[minmax(0,1.1fr)_minmax(320px,0.9fr)]", children: [_jsxs("div", { className: "rounded-[28px] border border-accent/20 bg-[linear-gradient(160deg,rgba(var(--accent),0.16),rgba(255,255,255,0.02))] p-5 sm:p-6", children: [_jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { children: [_jsx("div", { className: "text-[11px] uppercase tracking-[0.18em] text-muted", children: t("elizaclouddashboard.AvailableBalance") }), _jsxs("div", { className: `mt-3 text-4xl font-bold tracking-tight sm:text-5xl ${creditStatusColor}`, children: [cloudCurrency === "USD" ? "$" : `${cloudCurrency} `, cloudBalance.toFixed(2)] }), _jsx("div", { className: "mt-3 text-sm text-muted", children: t("elizaclouddashboard.InAppBillingReady") })] }), _jsxs("div", { className: "flex items-center gap-2", children: [billingLoading ? (_jsx(Loader2, { className: "h-4 w-4 animate-spin text-muted" })) : null, _jsx("span", { className: `rounded-full border px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.18em] ${summaryCritical
|
|
559
|
+
? "border-danger/30 bg-danger/10 text-danger"
|
|
560
|
+
: summaryLow
|
|
561
|
+
? "border-warn/30 bg-warn/10 text-warn"
|
|
562
|
+
: "border-ok/30 bg-ok/10 text-ok"}`, children: creditStatusTone })] })] }), _jsxs("div", { className: "mt-6 grid grid-cols-1 gap-3 sm:grid-cols-2", children: [_jsxs("div", { className: "rounded-2xl border border-border/40 bg-bg/30 px-4 py-3", children: [_jsx("div", { className: "text-[11px] uppercase tracking-[0.18em] text-muted", children: t("elizaclouddashboard.TopUpCredits") }), _jsx("div", { className: "mt-2 text-sm text-txt-strong", children: t("elizaclouddashboard.MinimumTopUp", {
|
|
563
|
+
amount: minimumTopUp.toFixed(2),
|
|
564
|
+
}) })] }), _jsxs("div", { className: "rounded-2xl border border-border/40 bg-bg/30 px-4 py-3", children: [_jsx("div", { className: "text-[11px] uppercase tracking-[0.18em] text-muted", children: t("elizaclouddashboard.AutoTopUp") }), _jsx("div", { className: "mt-2 text-sm text-txt-strong", children: autoTopUpEnabled
|
|
565
|
+
? t("elizaclouddashboard.Enabled")
|
|
566
|
+
: t("elizaclouddashboard.Disabled") })] })] })] }), _jsxs("div", { className: "rounded-[28px] border border-border/50 bg-bg/25 p-5 sm:p-6", children: [_jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { children: [_jsx("div", { className: "text-sm font-semibold text-txt-strong", children: t("elizaclouddashboard.AutoTopUp") }), _jsx("div", { className: "mt-1 text-sm text-muted", children: t("elizaclouddashboard.AutoTopUpDesc") })] }), _jsx("button", { type: "button", onClick: () => dispatchAutoTopUpForm({
|
|
567
|
+
type: "setEnabled",
|
|
568
|
+
value: !autoTopUpEnabled,
|
|
569
|
+
}), className: `relative inline-flex h-7 w-12 items-center rounded-full border transition-colors ${autoTopUpEnabled
|
|
570
|
+
? "border-accent bg-accent"
|
|
571
|
+
: "border-border/60 bg-bg/50"}`, "aria-label": t("elizaclouddashboard.ToggleAutoTopUp"), children: _jsx("span", { className: `inline-block h-5 w-5 rounded-full bg-white transition-transform ${autoTopUpEnabled ? "translate-x-6" : "translate-x-1"}` }) })] }), _jsx("div", { className: "mt-4 rounded-2xl border border-border/40 bg-bg/20 px-4 py-3 text-sm text-muted", children: autoTopUpHasPaymentMethod
|
|
572
|
+
? t("elizaclouddashboard.AutoTopUpPaymentReady")
|
|
573
|
+
: t("elizaclouddashboard.AutoTopUpNeedsPaymentMethod") }), _jsxs("div", { className: "mt-4 grid grid-cols-1 gap-3 sm:grid-cols-2", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "cloud-auto-topup-threshold", className: "text-xs font-medium text-muted", children: t("elizaclouddashboard.AutoTopUpThreshold") }), _jsx(Input, { id: "cloud-auto-topup-threshold", type: "number", min: String(autoTopUpMinThreshold), max: String(autoTopUpMaxThreshold), step: "1", value: autoTopUpThreshold, onChange: (event) => dispatchAutoTopUpForm({
|
|
574
|
+
type: "setThreshold",
|
|
575
|
+
value: event.target.value,
|
|
576
|
+
}), className: "rounded-xl bg-bg" })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "cloud-auto-topup-amount", className: "text-xs font-medium text-muted", children: t("elizaclouddashboard.AutoTopUpAmount") }), _jsx(Input, { id: "cloud-auto-topup-amount", type: "number", min: String(autoTopUpMinAmount), max: String(autoTopUpMaxAmount), step: "1", value: autoTopUpAmount, onChange: (event) => dispatchAutoTopUpForm({
|
|
577
|
+
type: "setAmount",
|
|
578
|
+
value: event.target.value,
|
|
579
|
+
}), className: "rounded-xl bg-bg" })] })] }), _jsxs("div", { className: "mt-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [_jsx("div", { className: "text-xs text-muted", children: t("elizaclouddashboard.AutoTopUpLimits", {
|
|
580
|
+
minAmount: autoTopUpMinAmount,
|
|
581
|
+
maxAmount: autoTopUpMaxAmount,
|
|
582
|
+
minThreshold: autoTopUpMinThreshold,
|
|
583
|
+
maxThreshold: autoTopUpMaxThreshold,
|
|
584
|
+
}) }), _jsxs(Button, { variant: "outline", className: "rounded-2xl border-border/50", disabled: billingSettingsBusy ||
|
|
585
|
+
billingLoading ||
|
|
586
|
+
!autoTopUpForm.dirty, onClick: () => void handleSaveBillingSettings(), children: [billingSettingsBusy ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : null, t("elizaclouddashboard.SaveBillingSettings")] })] })] })] }), _jsxs("div", { className: "mt-6 rounded-[28px] border border-border/50 bg-bg/25 p-5 sm:p-6", children: [_jsxs("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between", children: [_jsxs("div", { children: [_jsx("div", { className: "text-sm font-semibold text-txt-strong", children: t("elizaclouddashboard.TopUpCredits") }), _jsx("div", { className: "mt-1 text-sm text-muted", children: t("elizaclouddashboard.TopUpCreditsDesc") })] }), fallbackBillingUrl ? (_jsxs(Button, { variant: "ghost", className: "justify-start rounded-2xl px-0 text-sm text-muted hover:text-txt", onClick: () => void openExternalUrl(fallbackBillingUrl), children: [_jsx(ExternalLink, { className: "mr-2 h-4 w-4" }), t("elizaclouddashboard.OpenBrowserBilling")] })) : null] }), _jsxs("div", { className: "mt-5 grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(260px,0.8fr)]", children: [_jsxs("div", { className: "space-y-3", children: [_jsx("div", { className: "flex flex-wrap gap-2", children: BILLING_PRESET_AMOUNTS.map((amount) => (_jsxs("button", { type: "button", className: `rounded-xl border px-3 py-2 text-sm font-medium transition-colors ${billingAmount === String(amount)
|
|
587
|
+
? "border-accent bg-accent text-accent-fg"
|
|
588
|
+
: "border-border/50 bg-bg/30 text-txt hover:border-accent/40"}`, onClick: () => setBillingAmount(String(amount)), children: ["$", amount] }, amount))) }), _jsxs("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "cloud-billing-amount", className: "text-xs font-medium text-muted", children: t("elizaclouddashboard.CustomAmount") }), _jsx(Input, { id: "cloud-billing-amount", type: "number", min: String(minimumTopUp), step: "1", value: billingAmount, onChange: (event) => setBillingAmount(event.target.value), className: "rounded-xl bg-bg" })] }), _jsx("div", { className: "rounded-2xl border border-border/40 bg-bg/20 px-4 py-3 text-sm text-muted", children: t("elizaclouddashboard.MinimumTopUp", {
|
|
589
|
+
amount: minimumTopUp.toFixed(2),
|
|
590
|
+
}) })] })] }), _jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs(Button, { variant: "default", className: "h-12 rounded-2xl font-semibold", disabled: checkoutBusy || billingLoading, onClick: () => void handleStartCheckout(), children: [checkoutBusy ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(CreditCard, { className: "mr-2 h-4 w-4" })), t("elizaclouddashboard.PayWithCard")] }), _jsxs(Button, { variant: "outline", className: "h-12 rounded-2xl border-border/50", disabled: cryptoBusy || billingLoading, onClick: () => void handleCreateCryptoQuote(), children: [cryptoBusy ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(Wallet, { className: "mr-2 h-4 w-4" })), t("elizaclouddashboard.PayWithCrypto")] }), _jsx("div", { className: "rounded-2xl border border-border/40 bg-bg/20 px-4 py-3 text-xs text-muted", children: t("elizaclouddashboard.CheckoutProviderNote") })] })] })] })] }) }), _jsxs("div", { className: "space-y-8", children: [_jsx(SectionCard, { title: t("elizaclouddashboard.CryptoTopUp"), description: t("elizaclouddashboard.CryptoTopUpDesc"), className: "border-border/50 bg-bg/40 backdrop-blur-xl rounded-3xl shadow-sm", children: _jsxs("div", { className: "mt-2 space-y-4", children: [_jsx("div", { className: "rounded-2xl border border-border/40 bg-bg/25 px-4 py-3 text-sm text-muted", children: hasAgentWallet
|
|
591
|
+
? hasWalletFunds
|
|
592
|
+
? t("elizaclouddashboard.AgentWalletFunded")
|
|
593
|
+
: t("elizaclouddashboard.AgentWalletDetected")
|
|
594
|
+
: t("elizaclouddashboard.NoAgentWalletDetected") }), cryptoQuote ? (_jsxs("div", { className: "rounded-2xl border border-border/40 bg-bg/25 p-4", children: [_jsxs("div", { className: "space-y-2 text-sm", children: [_jsx("div", { className: "font-semibold text-txt-strong", children: readString(cryptoQuote.provider) ??
|
|
595
|
+
t("elizaclouddashboard.CryptoQuoteReady") }), _jsxs("div", { className: "text-muted", children: [readString(cryptoQuote.currency) ?? "USDC", " ", readString(cryptoQuote.amount) ?? "0", " on", " ", readString(cryptoQuote.network) ?? "selected network"] }), readString(cryptoQuote.payToAddress) && (_jsx("code", { className: "block rounded-xl border border-border/40 bg-bg/30 px-3 py-2 text-xs text-txt-strong break-all", children: readString(cryptoQuote.payToAddress) })), readString(cryptoQuote.expiresAt) && (_jsxs("div", { className: "text-xs text-muted", children: ["Expires", " ", new Date(readString(cryptoQuote.expiresAt) ?? "").toLocaleString()] }))] }), _jsxs("div", { className: "mt-4 flex flex-col gap-3", children: [readString(cryptoQuote.paymentLinkUrl) ? (_jsxs(Button, { variant: "outline", className: "rounded-2xl", onClick: () => void openExternalUrl(readString(cryptoQuote.paymentLinkUrl) ?? ""), children: [_jsx(ExternalLink, { className: "mr-2 h-4 w-4" }), t("elizaclouddashboard.OpenHostedCryptoCheckout")] })) : null, _jsxs(Button, { variant: "default", className: "rounded-2xl", disabled: cryptoPayBusy ||
|
|
596
|
+
!hasAgentWallet ||
|
|
597
|
+
!hasWalletFunds ||
|
|
598
|
+
readString(cryptoQuote.network)?.toLowerCase() !==
|
|
599
|
+
"bsc" ||
|
|
600
|
+
!readString(cryptoQuote.payToAddress) ||
|
|
601
|
+
!readString(cryptoQuote.amount), onClick: () => void handlePayCryptoFromAgentWallet(), children: [cryptoPayBusy ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(Wallet, { className: "mr-2 h-4 w-4" })), t("elizaclouddashboard.PayFromAgentWallet")] })] })] })) : (_jsx("div", { className: "rounded-2xl border border-dashed border-border/50 bg-bg/20 px-4 py-5 text-sm text-muted", children: t("elizaclouddashboard.CryptoQuoteHint") })), cryptoPayResult && (_jsx("div", { className: "rounded-2xl border border-ok/30 bg-ok/10 px-4 py-3 text-sm text-ok", children: cryptoPayResult }))] }) }), _jsx(SectionCard, { title: t("elizaclouddashboard.AccountDetails"), className: "border-border/50 bg-bg/40 backdrop-blur-xl rounded-3xl shadow-sm", children: _jsxs("div", { className: "space-y-4 mt-2", children: [_jsxs("div", { className: "p-3 rounded-2xl bg-bg/30 border border-border/30", children: [_jsx("span", { className: "text-[10px] text-muted uppercase font-bold tracking-wider mb-1 block", children: t("elizaclouddashboard.CloudUserID") }), _jsx("code", { className: "text-xs text-txt-strong break-all font-mono", children: elizaCloudUserId || t("elizaclouddashboard.NotAvailable") })] }), _jsxs("div", { className: "flex items-center justify-between p-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Shield, { className: "w-4 h-4 text-ok" }), _jsx("span", { className: "text-xs font-medium", children: t("elizaclouddashboard.SecurityStatus") })] }), _jsx("span", { className: "text-[10px] px-2 py-0.5 rounded-full bg-ok/10 text-ok font-bold uppercase tracking-wider border border-ok/20", children: t("elizaclouddashboard.Secure") })] }), _jsxs(Button, { variant: "link", className: "settings-compact-button w-full text-xs text-txt justify-start px-3 h-auto", onClick: () => void openExternalUrl(ELIZA_CLOUD_INSTANCES_URL), children: [t("elizaclouddashboard.AdvancedDashboard"), _jsx(ExternalLink, { className: "w-3 h-3 ml-2" })] })] }) })] })] })) : (_jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-8", children: [_jsxs("div", { className: "lg:col-span-2 space-y-8", children: [_jsxs(SectionCard, { title: t("elizaclouddashboard.CloudAgents"), description: t("elizaclouddashboard.CloudAgentsDesc"), className: "border-border/50 bg-bg/40 backdrop-blur-xl rounded-3xl overflow-hidden shadow-sm", children: [agentsError && (_jsxs("div", { className: "mt-4 flex items-center gap-2 text-sm text-danger bg-danger/10 rounded-xl p-3 border border-danger/20", children: [_jsx(AlertCircle, { className: "w-4 h-4 shrink-0" }), agentsError] })), _jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4 mt-4", children: agentsLoading && cloudAgents.length === 0 ? (_jsx("div", { className: "col-span-full flex items-center justify-center py-12", children: _jsx(Loader2, { className: "w-6 h-6 text-txt animate-spin" }) })) : (_jsxs(_Fragment, { children: [cloudAgents.map((agent) => (_jsx(CloudAgentCard, { agent: agent, onDelete: handleDeleteAgent, deleting: deletingAgentId === agent.agent_id, launching: launchingAgentId === agent.agent_id, onLaunch: handleLaunchAgent, onSelect: (id) => setSelectedAgentId(id) }, agent.agent_id))), showDeployForm ? (_jsx("div", { className: "aspect-[4/3] rounded-2xl border border-border/50 bg-bg/30 p-6 flex flex-col items-center justify-center text-center", children: _jsxs("div", { className: "w-full space-y-3", children: [_jsx("input", { placeholder: t("elizaclouddashboard.AgentName"), value: deployAgentName, onChange: (e) => setDeployAgentName(e.target.value), onKeyDown: (e) => {
|
|
602
|
+
if (e.key === "Enter")
|
|
603
|
+
void handleDeployAgent();
|
|
604
|
+
if (e.key === "Escape")
|
|
605
|
+
setShowDeployForm(false);
|
|
606
|
+
}, disabled: deploying, className: "w-full h-8 px-3 rounded-xl bg-bg/50 border border-border/40 text-xs text-center focus:outline-none focus:border-accent" }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { variant: "ghost", size: "sm", className: "flex-1 rounded-xl h-8 text-xs text-muted hover:text-txt-strong flex items-center justify-center p-0", onClick: () => setShowDeployForm(false), disabled: deploying, children: t("onboarding.cancel") }), _jsx(Button, { variant: "default", size: "sm", className: "flex-1 rounded-xl h-8 text-xs font-bold", onClick: handleDeployAgent, disabled: deploying || !deployAgentName.trim(), children: deploying ? (_jsx(Loader2, { className: "w-3 h-3 animate-spin mx-auto" })) : (t("elizaclouddashboard.Deploy")) })] })] }) })) : (_jsxs("button", { type: "button", className: "aspect-[4/3] rounded-2xl border border-dashed border-border/60 flex flex-col items-center justify-center p-6 text-center group hover:border-accent/50 hover:bg-accent/5 transition-all duration-300 cursor-pointer", onClick: () => setShowDeployForm(true), children: [_jsx("div", { className: "w-12 h-12 rounded-full bg-bg-accent flex items-center justify-center mb-4 group-hover:scale-110 transition-transform", children: _jsx(Plus, { className: "w-6 h-6 text-muted group-hover:text-txt" }) }), _jsx("h3", { className: "font-bold text-txt-strong mb-1", children: t("elizaclouddashboard.DeployNewAgent") }), _jsx("p", { className: "text-xs text-muted", children: t("elizaclouddashboard.InitializeInstance") })] }))] })) })] }), _jsx(SectionCard, { title: t("elizaclouddashboard.UsageMetrics"), description: t("elizaclouddashboard.UsageMetricsDesc"), className: "border-border/50 bg-bg/40 backdrop-blur-xl rounded-3xl shadow-sm", children: _jsx("div", { className: "h-48 flex items-center justify-center text-muted italic text-sm border border-border/30 rounded-2xl bg-bg/20 mt-4", children: t("elizaclouddashboard.MetricsPlaceholder") }) })] }), _jsx("div", { className: "space-y-8", children: selectedAgentId && selectedAgent ? (_jsx(AgentDetailSidebar, { agent: selectedAgent, onClose: () => setSelectedAgentId(null) })) : (_jsx(SectionCard, { title: t("elizaclouddashboard.AccountDetails"), className: "border-border/50 bg-bg/40 backdrop-blur-xl rounded-3xl shadow-sm", children: _jsxs("div", { className: "space-y-4 mt-2", children: [_jsxs("div", { className: "p-3 rounded-2xl bg-bg/30 border border-border/30", children: [_jsx("span", { className: "text-[10px] text-muted uppercase font-bold tracking-wider mb-1 block", children: t("elizaclouddashboard.CloudUserID") }), _jsx("code", { className: "text-xs text-txt-strong break-all font-mono", children: elizaCloudUserId ||
|
|
607
|
+
t("elizaclouddashboard.NotAvailable") })] }), _jsxs("div", { className: "rounded-2xl border border-accent/20 bg-accent/8 p-4", children: [_jsx("div", { className: "text-[11px] uppercase tracking-[0.18em] text-muted", children: t("elizaclouddashboard.AvailableBalance") }), _jsxs("div", { className: `mt-2 text-3xl font-bold ${creditStatusColor}`, children: ["$", cloudBalance.toFixed(2)] }), _jsx("div", { className: "mt-2 text-xs text-muted", children: creditStatusTone })] }), _jsxs(Button, { variant: "outline", className: "w-full justify-start rounded-2xl border-border/40 bg-bg/30 px-4 py-3 text-sm", onClick: () => setState("cloudDashboardView", "billing"), children: [_jsx(CircleDollarSign, { className: "mr-2 h-4 w-4" }), t("elizaclouddashboard.CloudBilling")] })] }) })) })] })), _jsx(Dialog, { open: checkoutDialogOpen, onOpenChange: (open) => {
|
|
608
|
+
setCheckoutDialogOpen(open);
|
|
609
|
+
if (!open) {
|
|
610
|
+
void fetchBillingData();
|
|
611
|
+
}
|
|
612
|
+
}, children: _jsxs(DialogContent, { className: "max-w-4xl", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t("elizaclouddashboard.PayWithCard") }) }), checkoutSession?.clientSecret && checkoutSession.publishableKey ? (_jsx(StripeEmbeddedCheckout, { publishableKey: checkoutSession.publishableKey, clientSecret: checkoutSession.clientSecret })) : (_jsx("div", { className: "rounded-2xl border border-border/40 bg-bg/25 px-4 py-5 text-sm text-muted", children: t("elizaclouddashboard.CheckoutProviderNote") }))] }) })] }));
|
|
613
|
+
}
|
|
614
|
+
function AgentDetailSidebar({ agent, onClose, }) {
|
|
615
|
+
const [logs, setLogs] = useState("");
|
|
616
|
+
const [statusDetail, setStatusDetail] = useState(null);
|
|
617
|
+
const logsEndRef = useRef(null);
|
|
618
|
+
useEffect(() => {
|
|
619
|
+
if (!agent)
|
|
620
|
+
return;
|
|
621
|
+
let mounted = true;
|
|
622
|
+
const fetchDetails = async () => {
|
|
623
|
+
try {
|
|
624
|
+
const [statusRes, logsRes] = await Promise.all([
|
|
625
|
+
client.getCloudCompatAgentStatus(agent.agent_id),
|
|
626
|
+
client.getCloudCompatAgentLogs(agent.agent_id, 100),
|
|
627
|
+
]);
|
|
628
|
+
if (!mounted)
|
|
629
|
+
return;
|
|
630
|
+
setStatusDetail(statusRes.data);
|
|
631
|
+
setLogs(typeof logsRes.data === "string" ? logsRes.data : "");
|
|
632
|
+
}
|
|
633
|
+
catch {
|
|
634
|
+
// Silently retry next tick
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
void fetchDetails();
|
|
638
|
+
const intId = setInterval(fetchDetails, 5000);
|
|
639
|
+
return () => {
|
|
640
|
+
mounted = false;
|
|
641
|
+
clearInterval(intId);
|
|
642
|
+
};
|
|
643
|
+
}, [agent]);
|
|
644
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: rerun when logs update
|
|
645
|
+
useEffect(() => {
|
|
646
|
+
if (logsEndRef.current) {
|
|
647
|
+
logsEndRef.current.scrollIntoView({ behavior: "smooth" });
|
|
648
|
+
}
|
|
649
|
+
}, [logs]);
|
|
650
|
+
if (!agent)
|
|
651
|
+
return null;
|
|
652
|
+
return (_jsx("div", { className: "space-y-4 animate-in slide-in-from-right-8 duration-300", children: _jsxs(SectionCard, { title: "Agent Details", className: "border-accent/40 bg-accent/5 backdrop-blur-xl rounded-3xl shadow-sm relative overflow-hidden", children: [_jsx("button", { type: "button", className: "absolute top-4 right-4 p-1 rounded-full hover:bg-bg/50 transition-colors text-muted hover:text-txt-strong", onClick: onClose, children: _jsx(X, { className: "w-5 h-5" }) }), _jsxs("div", { className: "mt-4 space-y-4", children: [_jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "p-3 rounded-xl bg-bg/40 border border-border/40", children: [_jsx("span", { className: "text-[10px] text-muted uppercase font-bold tracking-wider mb-1 block", children: "Status" }), _jsx(AgentStatusBadge, { status: statusDetail?.status || agent.status })] }), _jsxs("div", { className: "p-3 rounded-xl bg-bg/40 border border-border/40", children: [_jsx("span", { className: "text-[10px] text-muted uppercase font-bold tracking-wider mb-1 block", children: "DB Status" }), _jsx("span", { className: "text-xs font-mono", children: statusDetail?.databaseStatus || agent.database_status || "—" })] }), _jsxs("div", { className: "p-3 rounded-xl bg-bg/40 border border-border/40 col-span-2", children: [_jsx("span", { className: "text-[10px] text-muted uppercase font-bold tracking-wider mb-1 block", children: "Heartbeat" }), _jsx("span", { className: "text-xs font-mono", children: statusDetail?.lastHeartbeat
|
|
653
|
+
? new Date(statusDetail.lastHeartbeat).toLocaleString()
|
|
654
|
+
: agent.last_heartbeat_at
|
|
655
|
+
? new Date(agent.last_heartbeat_at).toLocaleString()
|
|
656
|
+
: "No heartbeat yet" })] })] }), _jsxs("div", { className: "p-3 rounded-xl bg-bg/80 border border-border/40", children: [_jsxs("span", { className: "text-[10px] text-muted uppercase font-bold tracking-wider mb-2 flex items-center gap-2", children: [_jsx(Terminal, { className: "w-3 h-3" }), " Live Logs"] }), _jsx("div", { className: "h-64 overflow-y-auto custom-scrollbar bg-black/50 rounded-lg p-3 border border-border/20", children: _jsxs("pre", { className: "text-[10px] font-mono text-txt-strong/80 whitespace-pre-wrap break-all", children: [logs || "No logs available. Deploying...", _jsx("div", { ref: logsEndRef })] }) })] })] })] }) }));
|
|
657
|
+
}
|