@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,1696 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
Dialog,
|
|
4
|
+
DialogContent,
|
|
5
|
+
DialogHeader,
|
|
6
|
+
DialogTitle,
|
|
7
|
+
Input,
|
|
8
|
+
SectionCard,
|
|
9
|
+
} from "@elizaos/ui";
|
|
10
|
+
import {
|
|
11
|
+
AlertCircle,
|
|
12
|
+
CircleDollarSign,
|
|
13
|
+
CreditCard,
|
|
14
|
+
ExternalLink,
|
|
15
|
+
LayoutDashboard,
|
|
16
|
+
Loader2,
|
|
17
|
+
Plus,
|
|
18
|
+
RefreshCw,
|
|
19
|
+
Server,
|
|
20
|
+
Shield,
|
|
21
|
+
Terminal,
|
|
22
|
+
Trash2,
|
|
23
|
+
Wallet,
|
|
24
|
+
X,
|
|
25
|
+
Zap,
|
|
26
|
+
} from "lucide-react";
|
|
27
|
+
import { useCallback, useEffect, useReducer, useRef, useState } from "react";
|
|
28
|
+
import {
|
|
29
|
+
type CloudBillingCheckoutResponse,
|
|
30
|
+
type CloudBillingSettings,
|
|
31
|
+
type CloudBillingSummary,
|
|
32
|
+
type CloudCompatAgent,
|
|
33
|
+
client,
|
|
34
|
+
} from "../api";
|
|
35
|
+
import { useApp } from "../state";
|
|
36
|
+
import { openExternalUrl } from "../utils";
|
|
37
|
+
import { StripeEmbeddedCheckout } from "./StripeEmbeddedCheckout";
|
|
38
|
+
|
|
39
|
+
const ELIZA_CLOUD_LOGIN_URL =
|
|
40
|
+
"https://www.elizacloud.ai/login?returnTo=%2Fdashboard%2Fmilady";
|
|
41
|
+
const ELIZA_CLOUD_INSTANCES_URL = "https://www.elizacloud.ai/dashboard/milady";
|
|
42
|
+
const BILLING_PRESET_AMOUNTS = [10, 25, 100];
|
|
43
|
+
|
|
44
|
+
const STATUS_BADGE: Record<string, { label: string; className: string }> = {
|
|
45
|
+
running: {
|
|
46
|
+
label: "Running",
|
|
47
|
+
className: "bg-ok/10 text-ok border-ok/20",
|
|
48
|
+
},
|
|
49
|
+
queued: {
|
|
50
|
+
label: "Queued",
|
|
51
|
+
className: "bg-warn/10 text-warn border-warn/20",
|
|
52
|
+
},
|
|
53
|
+
provisioning: {
|
|
54
|
+
label: "Provisioning",
|
|
55
|
+
className: "bg-accent/10 text-txt border-accent/20",
|
|
56
|
+
},
|
|
57
|
+
stopped: {
|
|
58
|
+
label: "Stopped",
|
|
59
|
+
className: "bg-muted/10 text-muted border-border/40",
|
|
60
|
+
},
|
|
61
|
+
failed: {
|
|
62
|
+
label: "Failed",
|
|
63
|
+
className: "bg-danger/10 text-danger border-danger/20",
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
function AgentStatusBadge({ status }: { status: string }) {
|
|
68
|
+
const badge = STATUS_BADGE[status] ?? STATUS_BADGE.stopped;
|
|
69
|
+
return (
|
|
70
|
+
<span
|
|
71
|
+
className={`text-[10px] px-2 py-0.5 rounded-full font-bold uppercase tracking-wider border ${badge?.className}`}
|
|
72
|
+
>
|
|
73
|
+
{badge?.label}
|
|
74
|
+
</span>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function CloudAgentCard({
|
|
79
|
+
agent,
|
|
80
|
+
onDelete,
|
|
81
|
+
deleting,
|
|
82
|
+
launching,
|
|
83
|
+
onLaunch,
|
|
84
|
+
onSelect,
|
|
85
|
+
}: {
|
|
86
|
+
agent: CloudCompatAgent;
|
|
87
|
+
onDelete: (id: string) => void;
|
|
88
|
+
deleting: boolean;
|
|
89
|
+
launching: boolean;
|
|
90
|
+
onLaunch: (id: string) => void;
|
|
91
|
+
onSelect?: (id: string) => void;
|
|
92
|
+
}) {
|
|
93
|
+
return (
|
|
94
|
+
// biome-ignore lint/a11y/useSemanticElements: cannot use button due to nested buttons
|
|
95
|
+
<div
|
|
96
|
+
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"
|
|
97
|
+
onClick={() => onSelect?.(agent.agent_id)}
|
|
98
|
+
onKeyDown={(e) => {
|
|
99
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
onSelect?.(agent.agent_id);
|
|
102
|
+
}
|
|
103
|
+
}}
|
|
104
|
+
role="button"
|
|
105
|
+
tabIndex={0}
|
|
106
|
+
>
|
|
107
|
+
<div className="flex items-start justify-between">
|
|
108
|
+
<div className="flex items-center gap-2">
|
|
109
|
+
<Server className="w-4 h-4 text-txt shrink-0" />
|
|
110
|
+
<span className="font-bold text-sm text-txt-strong truncate max-w-[140px]">
|
|
111
|
+
{agent.agent_name || "Unnamed Agent"}
|
|
112
|
+
</span>
|
|
113
|
+
</div>
|
|
114
|
+
<AgentStatusBadge status={agent.status} />
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<div className="text-[11px] text-muted space-y-1">
|
|
118
|
+
<div className="flex justify-between">
|
|
119
|
+
<span>Node</span>
|
|
120
|
+
<span className="font-mono text-txt-strong/70">
|
|
121
|
+
{agent.node_id?.slice(0, 8) ?? "—"}
|
|
122
|
+
</span>
|
|
123
|
+
</div>
|
|
124
|
+
<div className="flex justify-between">
|
|
125
|
+
<span>Created</span>
|
|
126
|
+
<span className="text-txt-strong/70">
|
|
127
|
+
{new Date(agent.created_at).toLocaleDateString()}
|
|
128
|
+
</span>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<div className="flex gap-2 mt-1">
|
|
133
|
+
<Button
|
|
134
|
+
variant="outline"
|
|
135
|
+
size="sm"
|
|
136
|
+
className="flex-1 rounded-xl h-8 text-xs border-border/40"
|
|
137
|
+
onClick={(event) => {
|
|
138
|
+
event.stopPropagation();
|
|
139
|
+
onLaunch(agent.agent_id);
|
|
140
|
+
}}
|
|
141
|
+
disabled={launching}
|
|
142
|
+
>
|
|
143
|
+
{launching ? (
|
|
144
|
+
<Loader2 className="w-3 h-3 mr-1 animate-spin" />
|
|
145
|
+
) : (
|
|
146
|
+
<ExternalLink className="w-3 h-3 mr-1" />
|
|
147
|
+
)}
|
|
148
|
+
Open
|
|
149
|
+
</Button>
|
|
150
|
+
|
|
151
|
+
<Button
|
|
152
|
+
variant="outline"
|
|
153
|
+
size="sm"
|
|
154
|
+
className="settings-icon-button rounded-xl h-8 text-xs border-danger/30 text-danger hover:bg-danger/10"
|
|
155
|
+
onClick={(event) => {
|
|
156
|
+
event.stopPropagation();
|
|
157
|
+
onDelete(agent.agent_id);
|
|
158
|
+
}}
|
|
159
|
+
disabled={deleting || launching}
|
|
160
|
+
>
|
|
161
|
+
{deleting ? (
|
|
162
|
+
<Loader2 className="w-3 h-3 animate-spin" />
|
|
163
|
+
) : (
|
|
164
|
+
<Trash2 className="w-3 h-3" />
|
|
165
|
+
)}
|
|
166
|
+
</Button>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
173
|
+
return typeof value === "object" && value !== null;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function unwrapBillingData<T extends Record<string, unknown>>(value: T): T {
|
|
177
|
+
if (isRecord(value.data)) {
|
|
178
|
+
return value.data as T;
|
|
179
|
+
}
|
|
180
|
+
return value;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function readString(value: unknown): string | undefined {
|
|
184
|
+
return typeof value === "string" && value.trim() ? value : undefined;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function readNumber(value: unknown): number | null {
|
|
188
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
189
|
+
if (typeof value === "string" && value.trim()) {
|
|
190
|
+
const parsed = Number(value);
|
|
191
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
192
|
+
}
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function readBoolean(value: unknown): boolean | undefined {
|
|
197
|
+
return typeof value === "boolean" ? value : undefined;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function normalizeBillingSummary(
|
|
201
|
+
raw: CloudBillingSummary,
|
|
202
|
+
): CloudBillingSummary {
|
|
203
|
+
const source = unwrapBillingData(raw);
|
|
204
|
+
return {
|
|
205
|
+
...raw,
|
|
206
|
+
...source,
|
|
207
|
+
balance:
|
|
208
|
+
readNumber(source.balance) ??
|
|
209
|
+
readNumber((source as Record<string, unknown>).creditBalance) ??
|
|
210
|
+
null,
|
|
211
|
+
currency:
|
|
212
|
+
readString(source.currency) ??
|
|
213
|
+
readString((source as Record<string, unknown>).balanceCurrency),
|
|
214
|
+
topUpUrl:
|
|
215
|
+
readString(source.topUpUrl) ??
|
|
216
|
+
readString((source as Record<string, unknown>).billingUrl),
|
|
217
|
+
embeddedCheckoutEnabled:
|
|
218
|
+
readBoolean(source.embeddedCheckoutEnabled) ??
|
|
219
|
+
readBoolean((source as Record<string, unknown>).embedded),
|
|
220
|
+
hostedCheckoutEnabled:
|
|
221
|
+
readBoolean(source.hostedCheckoutEnabled) ??
|
|
222
|
+
readBoolean((source as Record<string, unknown>).hosted),
|
|
223
|
+
cryptoEnabled:
|
|
224
|
+
readBoolean(source.cryptoEnabled) ??
|
|
225
|
+
readBoolean((source as Record<string, unknown>).crypto),
|
|
226
|
+
low: readBoolean(source.low),
|
|
227
|
+
critical: readBoolean(source.critical),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function normalizeBillingSettings(
|
|
232
|
+
raw: CloudBillingSettings,
|
|
233
|
+
): CloudBillingSettings {
|
|
234
|
+
const source = unwrapBillingData(raw);
|
|
235
|
+
return {
|
|
236
|
+
...raw,
|
|
237
|
+
...source,
|
|
238
|
+
settings: isRecord(source.settings) ? source.settings : raw.settings,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function getBillingAutoTopUp(
|
|
243
|
+
settings: CloudBillingSettings | null,
|
|
244
|
+
): Record<string, unknown> {
|
|
245
|
+
const rawSettings = isRecord(settings?.settings) ? settings.settings : null;
|
|
246
|
+
return isRecord(rawSettings?.autoTopUp) ? rawSettings.autoTopUp : {};
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function getBillingLimits(
|
|
250
|
+
settings: CloudBillingSettings | null,
|
|
251
|
+
): Record<string, unknown> {
|
|
252
|
+
const rawSettings = isRecord(settings?.settings) ? settings.settings : null;
|
|
253
|
+
return isRecord(rawSettings?.limits) ? rawSettings.limits : {};
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function resolveCheckoutUrl(
|
|
257
|
+
response: CloudBillingCheckoutResponse,
|
|
258
|
+
): string | null {
|
|
259
|
+
return (
|
|
260
|
+
readString(response.checkoutUrl) ??
|
|
261
|
+
readString(response.url) ??
|
|
262
|
+
readString((response as Record<string, unknown>).hostedUrl) ??
|
|
263
|
+
null
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
interface AutoTopUpFormState {
|
|
268
|
+
amount: string;
|
|
269
|
+
dirty: boolean;
|
|
270
|
+
enabled: boolean;
|
|
271
|
+
sourceKey: string;
|
|
272
|
+
threshold: string;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
type AutoTopUpFormAction =
|
|
276
|
+
| { type: "hydrate"; next: AutoTopUpFormState; force?: boolean }
|
|
277
|
+
| { type: "setAmount"; value: string }
|
|
278
|
+
| { type: "setEnabled"; value: boolean }
|
|
279
|
+
| { type: "setThreshold"; value: string };
|
|
280
|
+
|
|
281
|
+
function buildAutoTopUpFormState(
|
|
282
|
+
billingSummary: CloudBillingSummary | null,
|
|
283
|
+
billingSettings: CloudBillingSettings | null,
|
|
284
|
+
): AutoTopUpFormState {
|
|
285
|
+
const autoTopUp = getBillingAutoTopUp(billingSettings);
|
|
286
|
+
const minimumTopUp =
|
|
287
|
+
readNumber(
|
|
288
|
+
(billingSummary as Record<string, unknown> | null)?.minimumTopUp,
|
|
289
|
+
) ?? 1;
|
|
290
|
+
const enabled = readBoolean(autoTopUp.enabled) ?? false;
|
|
291
|
+
const amount = String(readNumber(autoTopUp.amount) ?? minimumTopUp);
|
|
292
|
+
const threshold = String(readNumber(autoTopUp.threshold) ?? 5);
|
|
293
|
+
return {
|
|
294
|
+
amount,
|
|
295
|
+
dirty: false,
|
|
296
|
+
enabled,
|
|
297
|
+
sourceKey: JSON.stringify([enabled, amount, threshold]),
|
|
298
|
+
threshold,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function autoTopUpFormReducer(
|
|
303
|
+
state: AutoTopUpFormState,
|
|
304
|
+
action: AutoTopUpFormAction,
|
|
305
|
+
): AutoTopUpFormState {
|
|
306
|
+
switch (action.type) {
|
|
307
|
+
case "hydrate":
|
|
308
|
+
if (!action.force && state.dirty) {
|
|
309
|
+
return state;
|
|
310
|
+
}
|
|
311
|
+
if (state.sourceKey === action.next.sourceKey && !state.dirty) {
|
|
312
|
+
return state;
|
|
313
|
+
}
|
|
314
|
+
return action.next;
|
|
315
|
+
case "setAmount":
|
|
316
|
+
return { ...state, amount: action.value, dirty: true };
|
|
317
|
+
case "setEnabled":
|
|
318
|
+
return { ...state, enabled: action.value, dirty: true };
|
|
319
|
+
case "setThreshold":
|
|
320
|
+
return { ...state, threshold: action.value, dirty: true };
|
|
321
|
+
default:
|
|
322
|
+
return state;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export function CloudDashboard() {
|
|
327
|
+
const {
|
|
328
|
+
t,
|
|
329
|
+
elizaCloudConnected,
|
|
330
|
+
elizaCloudCredits,
|
|
331
|
+
elizaCloudCreditsLow,
|
|
332
|
+
elizaCloudCreditsCritical,
|
|
333
|
+
elizaCloudTopUpUrl,
|
|
334
|
+
elizaCloudUserId,
|
|
335
|
+
cloudDashboardView,
|
|
336
|
+
elizaCloudLoginBusy,
|
|
337
|
+
handleCloudLogin,
|
|
338
|
+
handleCloudDisconnect,
|
|
339
|
+
elizaCloudDisconnecting: cloudDisconnecting,
|
|
340
|
+
loadDropStatus,
|
|
341
|
+
walletAddresses,
|
|
342
|
+
walletBalances,
|
|
343
|
+
retryStartup,
|
|
344
|
+
setActionNotice,
|
|
345
|
+
setState,
|
|
346
|
+
setTab,
|
|
347
|
+
} = useApp();
|
|
348
|
+
|
|
349
|
+
const [refreshing, setRefreshing] = useState(false);
|
|
350
|
+
const [billingLoading, setBillingLoading] = useState(false);
|
|
351
|
+
const [billingError, setBillingError] = useState<string | null>(null);
|
|
352
|
+
const [billingSummary, setBillingSummary] =
|
|
353
|
+
useState<CloudBillingSummary | null>(null);
|
|
354
|
+
const [billingSettings, setBillingSettings] =
|
|
355
|
+
useState<CloudBillingSettings | null>(null);
|
|
356
|
+
const [billingAmount, setBillingAmount] = useState("25");
|
|
357
|
+
const [autoTopUpForm, dispatchAutoTopUpForm] = useReducer(
|
|
358
|
+
autoTopUpFormReducer,
|
|
359
|
+
buildAutoTopUpFormState(null, null),
|
|
360
|
+
);
|
|
361
|
+
const [billingSettingsBusy, setBillingSettingsBusy] = useState(false);
|
|
362
|
+
const [checkoutBusy, setCheckoutBusy] = useState(false);
|
|
363
|
+
const [checkoutSession, setCheckoutSession] =
|
|
364
|
+
useState<CloudBillingCheckoutResponse | null>(null);
|
|
365
|
+
const [checkoutDialogOpen, setCheckoutDialogOpen] = useState(false);
|
|
366
|
+
const [cryptoBusy, setCryptoBusy] = useState(false);
|
|
367
|
+
const [cryptoQuote, setCryptoQuote] = useState<Record<
|
|
368
|
+
string,
|
|
369
|
+
unknown
|
|
370
|
+
> | null>(null);
|
|
371
|
+
const [cryptoPayBusy, setCryptoPayBusy] = useState(false);
|
|
372
|
+
const [cryptoPayResult, setCryptoPayResult] = useState<string | null>(null);
|
|
373
|
+
const [cloudAgents, setCloudAgents] = useState<CloudCompatAgent[]>([]);
|
|
374
|
+
const [agentsLoading, setAgentsLoading] = useState(false);
|
|
375
|
+
const [agentsError, setAgentsError] = useState<string | null>(null);
|
|
376
|
+
const [deletingAgentId, setDeletingAgentId] = useState<string | null>(null);
|
|
377
|
+
const [launchingAgentId, setLaunchingAgentId] = useState<string | null>(null);
|
|
378
|
+
const [selectedAgentId, setSelectedAgentId] = useState<string | null>(null);
|
|
379
|
+
const selectedAgent = cloudAgents.find((a) => a.agent_id === selectedAgentId);
|
|
380
|
+
const [showDeployForm, setShowDeployForm] = useState(false);
|
|
381
|
+
const [deployAgentName, setDeployAgentName] = useState("");
|
|
382
|
+
const [deploying, setDeploying] = useState(false);
|
|
383
|
+
const mountedRef = useRef(true);
|
|
384
|
+
const autoTopUpEnabled = autoTopUpForm.enabled;
|
|
385
|
+
const autoTopUpAmount = autoTopUpForm.amount;
|
|
386
|
+
const autoTopUpThreshold = autoTopUpForm.threshold;
|
|
387
|
+
|
|
388
|
+
const fetchCloudAgents = useCallback(async () => {
|
|
389
|
+
setAgentsLoading(true);
|
|
390
|
+
setAgentsError(null);
|
|
391
|
+
try {
|
|
392
|
+
const data = await client.getCloudCompatAgents();
|
|
393
|
+
if (!mountedRef.current) return;
|
|
394
|
+
setCloudAgents(Array.isArray(data.data) ? data.data : []);
|
|
395
|
+
} catch (err) {
|
|
396
|
+
if (!mountedRef.current) return;
|
|
397
|
+
setAgentsError(
|
|
398
|
+
err instanceof Error ? err.message : "Failed to load cloud agents",
|
|
399
|
+
);
|
|
400
|
+
setCloudAgents([]);
|
|
401
|
+
} finally {
|
|
402
|
+
if (mountedRef.current) setAgentsLoading(false);
|
|
403
|
+
}
|
|
404
|
+
}, []);
|
|
405
|
+
|
|
406
|
+
const fetchBillingData = useCallback(async () => {
|
|
407
|
+
setBillingLoading(true);
|
|
408
|
+
setBillingError(null);
|
|
409
|
+
try {
|
|
410
|
+
const [summaryResponse, settingsResponse] = await Promise.all([
|
|
411
|
+
client.getCloudBillingSummary().catch((err) => ({ __error: err })),
|
|
412
|
+
client.getCloudBillingSettings().catch((err) => ({
|
|
413
|
+
__error: err,
|
|
414
|
+
})),
|
|
415
|
+
]);
|
|
416
|
+
|
|
417
|
+
if (!mountedRef.current) return;
|
|
418
|
+
|
|
419
|
+
if (isRecord(summaryResponse) && "__error" in summaryResponse) {
|
|
420
|
+
const err = summaryResponse.__error;
|
|
421
|
+
throw err instanceof Error
|
|
422
|
+
? err
|
|
423
|
+
: new Error("Billing summary unavailable.");
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
setBillingSummary(normalizeBillingSummary(summaryResponse));
|
|
427
|
+
|
|
428
|
+
if (isRecord(settingsResponse) && !("__error" in settingsResponse)) {
|
|
429
|
+
setBillingSettings(normalizeBillingSettings(settingsResponse));
|
|
430
|
+
} else {
|
|
431
|
+
setBillingSettings(null);
|
|
432
|
+
}
|
|
433
|
+
} catch (err) {
|
|
434
|
+
if (!mountedRef.current) return;
|
|
435
|
+
setBillingSummary(null);
|
|
436
|
+
setBillingSettings(null);
|
|
437
|
+
setBillingError(
|
|
438
|
+
err instanceof Error ? err.message : "Failed to load billing data.",
|
|
439
|
+
);
|
|
440
|
+
} finally {
|
|
441
|
+
if (mountedRef.current) {
|
|
442
|
+
setBillingLoading(false);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}, []);
|
|
446
|
+
|
|
447
|
+
useEffect(() => {
|
|
448
|
+
dispatchAutoTopUpForm({
|
|
449
|
+
type: "hydrate",
|
|
450
|
+
next: buildAutoTopUpFormState(billingSummary, billingSettings),
|
|
451
|
+
});
|
|
452
|
+
}, [billingSettings, billingSummary]);
|
|
453
|
+
|
|
454
|
+
const handleDeleteAgent = useCallback(
|
|
455
|
+
async (agentId: string) => {
|
|
456
|
+
setDeletingAgentId(agentId);
|
|
457
|
+
try {
|
|
458
|
+
const data = await client.deleteCloudCompatAgent(agentId);
|
|
459
|
+
if (data.success) {
|
|
460
|
+
setCloudAgents((prev) => prev.filter((a) => a.agent_id !== agentId));
|
|
461
|
+
}
|
|
462
|
+
} catch {
|
|
463
|
+
// Silently fail — user can retry
|
|
464
|
+
} finally {
|
|
465
|
+
setDeletingAgentId(null);
|
|
466
|
+
if (selectedAgentId === agentId) setSelectedAgentId(null);
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
[selectedAgentId],
|
|
470
|
+
);
|
|
471
|
+
|
|
472
|
+
const handleDeployAgent = useCallback(async () => {
|
|
473
|
+
if (!deployAgentName.trim()) return;
|
|
474
|
+
setDeploying(true);
|
|
475
|
+
try {
|
|
476
|
+
const response = await client.createCloudCompatAgent({
|
|
477
|
+
agentName: deployAgentName.trim(),
|
|
478
|
+
});
|
|
479
|
+
if (response.success) {
|
|
480
|
+
await fetchCloudAgents();
|
|
481
|
+
setShowDeployForm(false);
|
|
482
|
+
setDeployAgentName("");
|
|
483
|
+
}
|
|
484
|
+
} catch {
|
|
485
|
+
// Intentionally swallow for now
|
|
486
|
+
} finally {
|
|
487
|
+
setDeploying(false);
|
|
488
|
+
}
|
|
489
|
+
}, [deployAgentName, fetchCloudAgents]);
|
|
490
|
+
|
|
491
|
+
const handleLaunchAgent = useCallback(
|
|
492
|
+
async (agentId: string) => {
|
|
493
|
+
setLaunchingAgentId(agentId);
|
|
494
|
+
try {
|
|
495
|
+
const response = await client.launchCloudCompatAgent(agentId);
|
|
496
|
+
if (!response.success || !response.data?.connection?.apiBase) {
|
|
497
|
+
throw new Error("Eliza Cloud did not return a launch connection.");
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
const { connection } = response.data;
|
|
501
|
+
client.setBaseUrl(connection.apiBase);
|
|
502
|
+
client.setToken(connection.token);
|
|
503
|
+
setState("startupError", null);
|
|
504
|
+
setState("onboardingRunMode", "cloud");
|
|
505
|
+
setState("onboardingCloudProvider", "elizacloud");
|
|
506
|
+
setState("onboardingRemoteApiBase", connection.apiBase);
|
|
507
|
+
setState("onboardingRemoteToken", connection.token);
|
|
508
|
+
setState("onboardingRemoteError", null);
|
|
509
|
+
setState("onboardingRemoteConnecting", false);
|
|
510
|
+
setState("onboardingRemoteConnected", false);
|
|
511
|
+
setActionNotice(
|
|
512
|
+
"Opened managed Eliza Cloud instance.",
|
|
513
|
+
"success",
|
|
514
|
+
3000,
|
|
515
|
+
);
|
|
516
|
+
setTab("chat");
|
|
517
|
+
retryStartup();
|
|
518
|
+
} catch (err) {
|
|
519
|
+
setActionNotice(
|
|
520
|
+
err instanceof Error
|
|
521
|
+
? err.message
|
|
522
|
+
: "Failed to open Eliza Cloud instance.",
|
|
523
|
+
"error",
|
|
524
|
+
4200,
|
|
525
|
+
);
|
|
526
|
+
} finally {
|
|
527
|
+
if (mountedRef.current) {
|
|
528
|
+
setLaunchingAgentId(null);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
[retryStartup, setActionNotice, setState, setTab],
|
|
533
|
+
);
|
|
534
|
+
|
|
535
|
+
const handleRefresh = useCallback(async () => {
|
|
536
|
+
setRefreshing(true);
|
|
537
|
+
await Promise.all([
|
|
538
|
+
loadDropStatus(),
|
|
539
|
+
fetchCloudAgents(),
|
|
540
|
+
fetchBillingData(),
|
|
541
|
+
]);
|
|
542
|
+
setTimeout(() => setRefreshing(false), 600);
|
|
543
|
+
}, [fetchBillingData, fetchCloudAgents, loadDropStatus]);
|
|
544
|
+
|
|
545
|
+
const handleSaveBillingSettings = useCallback(async () => {
|
|
546
|
+
const limits = getBillingLimits(billingSettings);
|
|
547
|
+
const amount = Number(autoTopUpAmount);
|
|
548
|
+
const threshold = Number(autoTopUpThreshold);
|
|
549
|
+
const minAmount = readNumber(limits.minAmount) ?? 1;
|
|
550
|
+
const maxAmount = readNumber(limits.maxAmount) ?? 1000;
|
|
551
|
+
const minThreshold = readNumber(limits.minThreshold) ?? 0;
|
|
552
|
+
const maxThreshold = readNumber(limits.maxThreshold) ?? 1000;
|
|
553
|
+
const hasPaymentMethod =
|
|
554
|
+
readBoolean(getBillingAutoTopUp(billingSettings).hasPaymentMethod) ??
|
|
555
|
+
readBoolean(
|
|
556
|
+
(billingSummary as Record<string, unknown> | null)?.hasPaymentMethod,
|
|
557
|
+
) ??
|
|
558
|
+
false;
|
|
559
|
+
|
|
560
|
+
if (!Number.isFinite(amount) || amount < minAmount || amount > maxAmount) {
|
|
561
|
+
setActionNotice(
|
|
562
|
+
`Auto top-up amount must be between $${minAmount} and $${maxAmount}.`,
|
|
563
|
+
"error",
|
|
564
|
+
3600,
|
|
565
|
+
);
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
if (
|
|
570
|
+
!Number.isFinite(threshold) ||
|
|
571
|
+
threshold < minThreshold ||
|
|
572
|
+
threshold > maxThreshold
|
|
573
|
+
) {
|
|
574
|
+
setActionNotice(
|
|
575
|
+
`Auto top-up threshold must be between $${minThreshold} and $${maxThreshold}.`,
|
|
576
|
+
"error",
|
|
577
|
+
3600,
|
|
578
|
+
);
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
if (autoTopUpEnabled && !hasPaymentMethod) {
|
|
583
|
+
setActionNotice(
|
|
584
|
+
"Save a payment method through card checkout before enabling auto top-up.",
|
|
585
|
+
"info",
|
|
586
|
+
4200,
|
|
587
|
+
);
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
setBillingSettingsBusy(true);
|
|
592
|
+
try {
|
|
593
|
+
const response = await client.updateCloudBillingSettings({
|
|
594
|
+
autoTopUp: {
|
|
595
|
+
enabled: autoTopUpEnabled,
|
|
596
|
+
amount,
|
|
597
|
+
threshold,
|
|
598
|
+
},
|
|
599
|
+
});
|
|
600
|
+
if (!mountedRef.current) return;
|
|
601
|
+
const normalizedSettings = normalizeBillingSettings(response);
|
|
602
|
+
setBillingSettings(normalizedSettings);
|
|
603
|
+
dispatchAutoTopUpForm({
|
|
604
|
+
type: "hydrate",
|
|
605
|
+
next: buildAutoTopUpFormState(billingSummary, normalizedSettings),
|
|
606
|
+
force: true,
|
|
607
|
+
});
|
|
608
|
+
await fetchBillingData();
|
|
609
|
+
setActionNotice("Billing settings updated.", "success", 3200);
|
|
610
|
+
} catch (err) {
|
|
611
|
+
setActionNotice(
|
|
612
|
+
err instanceof Error
|
|
613
|
+
? err.message
|
|
614
|
+
: "Failed to update billing settings.",
|
|
615
|
+
"error",
|
|
616
|
+
4200,
|
|
617
|
+
);
|
|
618
|
+
} finally {
|
|
619
|
+
if (mountedRef.current) {
|
|
620
|
+
setBillingSettingsBusy(false);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
}, [
|
|
624
|
+
autoTopUpAmount,
|
|
625
|
+
autoTopUpEnabled,
|
|
626
|
+
autoTopUpThreshold,
|
|
627
|
+
billingSettings,
|
|
628
|
+
billingSummary,
|
|
629
|
+
fetchBillingData,
|
|
630
|
+
setActionNotice,
|
|
631
|
+
]);
|
|
632
|
+
|
|
633
|
+
const handleStartCheckout = useCallback(async () => {
|
|
634
|
+
const minimumTopUp =
|
|
635
|
+
readNumber(
|
|
636
|
+
(billingSummary as Record<string, unknown> | null)?.minimumTopUp,
|
|
637
|
+
) ?? 1;
|
|
638
|
+
const amountUsd = Number(billingAmount);
|
|
639
|
+
if (!Number.isFinite(amountUsd) || amountUsd < minimumTopUp) {
|
|
640
|
+
setActionNotice(
|
|
641
|
+
`Enter a top-up amount of at least $${minimumTopUp}.`,
|
|
642
|
+
"error",
|
|
643
|
+
3200,
|
|
644
|
+
);
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
setCheckoutBusy(true);
|
|
649
|
+
try {
|
|
650
|
+
const response = await client.createCloudBillingCheckout({
|
|
651
|
+
amountUsd,
|
|
652
|
+
mode: billingSummary?.embeddedCheckoutEnabled ? "embedded" : "hosted",
|
|
653
|
+
});
|
|
654
|
+
|
|
655
|
+
const clientSecret = readString(response.clientSecret);
|
|
656
|
+
const publishableKey = readString(response.publishableKey);
|
|
657
|
+
if (clientSecret && publishableKey) {
|
|
658
|
+
setCheckoutSession(response);
|
|
659
|
+
setCheckoutDialogOpen(true);
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
const checkoutUrl = resolveCheckoutUrl(response);
|
|
664
|
+
if (checkoutUrl) {
|
|
665
|
+
await openExternalUrl(checkoutUrl);
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
throw new Error(
|
|
670
|
+
readString(response.message) ??
|
|
671
|
+
"Eliza Cloud did not return a checkout session.",
|
|
672
|
+
);
|
|
673
|
+
} catch (err) {
|
|
674
|
+
setActionNotice(
|
|
675
|
+
err instanceof Error ? err.message : "Failed to start checkout.",
|
|
676
|
+
"error",
|
|
677
|
+
4200,
|
|
678
|
+
);
|
|
679
|
+
} finally {
|
|
680
|
+
setCheckoutBusy(false);
|
|
681
|
+
}
|
|
682
|
+
}, [billingAmount, billingSummary, setActionNotice]);
|
|
683
|
+
|
|
684
|
+
const handleCreateCryptoQuote = useCallback(async () => {
|
|
685
|
+
const minimumTopUp =
|
|
686
|
+
readNumber(
|
|
687
|
+
(billingSummary as Record<string, unknown> | null)?.minimumTopUp,
|
|
688
|
+
) ?? 1;
|
|
689
|
+
const amountUsd = Number(billingAmount);
|
|
690
|
+
if (!Number.isFinite(amountUsd) || amountUsd < minimumTopUp) {
|
|
691
|
+
setActionNotice(
|
|
692
|
+
`Enter a top-up amount of at least $${minimumTopUp}.`,
|
|
693
|
+
"error",
|
|
694
|
+
3200,
|
|
695
|
+
);
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
setCryptoBusy(true);
|
|
700
|
+
setCryptoPayResult(null);
|
|
701
|
+
try {
|
|
702
|
+
const response = await client.createCloudBillingCryptoQuote({
|
|
703
|
+
amountUsd,
|
|
704
|
+
walletAddress:
|
|
705
|
+
walletAddresses?.evmAddress ??
|
|
706
|
+
walletAddresses?.solanaAddress ??
|
|
707
|
+
undefined,
|
|
708
|
+
});
|
|
709
|
+
setCryptoQuote(response as Record<string, unknown>);
|
|
710
|
+
} catch (err) {
|
|
711
|
+
setCryptoQuote(null);
|
|
712
|
+
setActionNotice(
|
|
713
|
+
err instanceof Error ? err.message : "Failed to request crypto quote.",
|
|
714
|
+
"error",
|
|
715
|
+
4200,
|
|
716
|
+
);
|
|
717
|
+
} finally {
|
|
718
|
+
setCryptoBusy(false);
|
|
719
|
+
}
|
|
720
|
+
}, [billingAmount, billingSummary, setActionNotice, walletAddresses]);
|
|
721
|
+
|
|
722
|
+
const handlePayCryptoFromAgentWallet = useCallback(async () => {
|
|
723
|
+
if (!cryptoQuote) return;
|
|
724
|
+
|
|
725
|
+
const network = readString(cryptoQuote.network)?.toLowerCase();
|
|
726
|
+
const payToAddress =
|
|
727
|
+
readString(cryptoQuote.payToAddress) ??
|
|
728
|
+
readString((cryptoQuote as Record<string, unknown>).address);
|
|
729
|
+
const amount = readString(cryptoQuote.amount);
|
|
730
|
+
const currency = readString(cryptoQuote.currency) ?? "USDC";
|
|
731
|
+
const tokenAddress = readString(cryptoQuote.tokenAddress);
|
|
732
|
+
|
|
733
|
+
if (!network || network !== "bsc") {
|
|
734
|
+
setActionNotice(
|
|
735
|
+
"Agent-wallet payment is currently wired for BSC quotes only.",
|
|
736
|
+
"info",
|
|
737
|
+
4200,
|
|
738
|
+
);
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
if (!payToAddress || !amount) {
|
|
743
|
+
setActionNotice(
|
|
744
|
+
"Crypto quote is missing transfer details.",
|
|
745
|
+
"error",
|
|
746
|
+
4200,
|
|
747
|
+
);
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
setCryptoPayBusy(true);
|
|
752
|
+
try {
|
|
753
|
+
const result = await client.executeBscTransfer({
|
|
754
|
+
toAddress: payToAddress,
|
|
755
|
+
amount,
|
|
756
|
+
assetSymbol: currency,
|
|
757
|
+
tokenAddress: tokenAddress ?? undefined,
|
|
758
|
+
confirm: true,
|
|
759
|
+
});
|
|
760
|
+
|
|
761
|
+
if (result.executed && result.execution?.hash) {
|
|
762
|
+
setCryptoPayResult(
|
|
763
|
+
`Submitted ${currency} payment: ${result.execution.hash}`,
|
|
764
|
+
);
|
|
765
|
+
setActionNotice(
|
|
766
|
+
"Crypto payment submitted from the agent wallet.",
|
|
767
|
+
"success",
|
|
768
|
+
);
|
|
769
|
+
} else if (result.requiresUserSignature) {
|
|
770
|
+
setCryptoPayResult(
|
|
771
|
+
"Cloud returned an unsigned payment request. Sign it from the wallet flow to complete payment.",
|
|
772
|
+
);
|
|
773
|
+
setActionNotice(
|
|
774
|
+
"This wallet requires user-sign mode for crypto payment.",
|
|
775
|
+
"info",
|
|
776
|
+
4200,
|
|
777
|
+
);
|
|
778
|
+
}
|
|
779
|
+
} catch (err) {
|
|
780
|
+
setCryptoPayResult(null);
|
|
781
|
+
setActionNotice(
|
|
782
|
+
err instanceof Error ? err.message : "Crypto payment failed.",
|
|
783
|
+
"error",
|
|
784
|
+
4200,
|
|
785
|
+
);
|
|
786
|
+
} finally {
|
|
787
|
+
setCryptoPayBusy(false);
|
|
788
|
+
}
|
|
789
|
+
}, [cryptoQuote, setActionNotice]);
|
|
790
|
+
|
|
791
|
+
useEffect(() => {
|
|
792
|
+
mountedRef.current = true;
|
|
793
|
+
return () => {
|
|
794
|
+
mountedRef.current = false;
|
|
795
|
+
};
|
|
796
|
+
}, []);
|
|
797
|
+
|
|
798
|
+
useEffect(() => {
|
|
799
|
+
if (elizaCloudConnected) {
|
|
800
|
+
void loadDropStatus();
|
|
801
|
+
void fetchCloudAgents();
|
|
802
|
+
void fetchBillingData();
|
|
803
|
+
}
|
|
804
|
+
}, [fetchBillingData, fetchCloudAgents, loadDropStatus, elizaCloudConnected]);
|
|
805
|
+
|
|
806
|
+
const summaryCritical =
|
|
807
|
+
billingSummary?.critical ?? elizaCloudCreditsCritical ?? false;
|
|
808
|
+
const summaryLow = billingSummary?.low ?? elizaCloudCreditsLow ?? false;
|
|
809
|
+
const creditStatusColor = summaryCritical
|
|
810
|
+
? "text-danger"
|
|
811
|
+
: summaryLow
|
|
812
|
+
? "text-warn"
|
|
813
|
+
: "text-ok";
|
|
814
|
+
const activeView = cloudDashboardView;
|
|
815
|
+
const cloudBalance = billingSummary?.balance ?? elizaCloudCredits ?? 0;
|
|
816
|
+
const cloudCurrency = billingSummary?.currency ?? "USD";
|
|
817
|
+
const fallbackBillingUrl =
|
|
818
|
+
billingSummary?.topUpUrl ?? elizaCloudTopUpUrl ?? null;
|
|
819
|
+
const minimumTopUp =
|
|
820
|
+
readNumber(
|
|
821
|
+
(billingSummary as Record<string, unknown> | null)?.minimumTopUp,
|
|
822
|
+
) ?? 1;
|
|
823
|
+
const billingAutoTopUp = getBillingAutoTopUp(billingSettings);
|
|
824
|
+
const billingLimits = getBillingLimits(billingSettings);
|
|
825
|
+
const autoTopUpHasPaymentMethod =
|
|
826
|
+
readBoolean(billingAutoTopUp.hasPaymentMethod) ??
|
|
827
|
+
readBoolean(
|
|
828
|
+
(billingSummary as Record<string, unknown> | null)?.hasPaymentMethod,
|
|
829
|
+
) ??
|
|
830
|
+
false;
|
|
831
|
+
const autoTopUpMinAmount =
|
|
832
|
+
readNumber(billingLimits.minAmount) ?? minimumTopUp;
|
|
833
|
+
const autoTopUpMaxAmount = readNumber(billingLimits.maxAmount) ?? 1000;
|
|
834
|
+
const autoTopUpMinThreshold = readNumber(billingLimits.minThreshold) ?? 0;
|
|
835
|
+
const autoTopUpMaxThreshold = readNumber(billingLimits.maxThreshold) ?? 1000;
|
|
836
|
+
const creditStatusTone = summaryCritical
|
|
837
|
+
? t("elizaclouddashboard.CreditsCritical")
|
|
838
|
+
: summaryLow
|
|
839
|
+
? t("elizaclouddashboard.CreditsLow")
|
|
840
|
+
: t("elizaclouddashboard.CreditsHealthy");
|
|
841
|
+
const hasAgentWallet = Boolean(
|
|
842
|
+
walletAddresses?.evmAddress || walletAddresses?.solanaAddress,
|
|
843
|
+
);
|
|
844
|
+
const hasWalletFunds = Boolean(
|
|
845
|
+
walletBalances?.evm?.chains.some(
|
|
846
|
+
(chain) =>
|
|
847
|
+
Number(chain.nativeBalance) > 0 ||
|
|
848
|
+
chain.tokens.some((token) => Number(token.balance) > 0),
|
|
849
|
+
) ||
|
|
850
|
+
((walletBalances?.solana &&
|
|
851
|
+
(Number(walletBalances.solana.solBalance) > 0 ||
|
|
852
|
+
walletBalances.solana.tokens.some(
|
|
853
|
+
(token) => Number(token.balance) > 0,
|
|
854
|
+
))) ??
|
|
855
|
+
false),
|
|
856
|
+
);
|
|
857
|
+
|
|
858
|
+
if (!elizaCloudConnected) {
|
|
859
|
+
return (
|
|
860
|
+
<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">
|
|
861
|
+
<div className="w-12 h-12 rounded-2xl bg-accent/10 flex items-center justify-center mb-5 border border-accent/20">
|
|
862
|
+
<Zap className="w-6 h-6 text-txt" />
|
|
863
|
+
</div>
|
|
864
|
+
<p className="text-sm text-muted mb-6 leading-relaxed">
|
|
865
|
+
{t("elizaclouddashboard.ScaleYourAgents")}
|
|
866
|
+
</p>
|
|
867
|
+
<Button
|
|
868
|
+
variant="default"
|
|
869
|
+
size="sm"
|
|
870
|
+
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"
|
|
871
|
+
onClick={handleCloudLogin}
|
|
872
|
+
disabled={elizaCloudLoginBusy}
|
|
873
|
+
>
|
|
874
|
+
{elizaCloudLoginBusy ? (
|
|
875
|
+
<RefreshCw className="w-4 h-4 mr-2 animate-spin" />
|
|
876
|
+
) : (
|
|
877
|
+
<Zap className="w-4 h-4 mr-2" />
|
|
878
|
+
)}
|
|
879
|
+
{elizaCloudLoginBusy
|
|
880
|
+
? t("elizaclouddashboard.Connecting")
|
|
881
|
+
: t("elizaclouddashboard.ConnectElizaCloud")}
|
|
882
|
+
</Button>
|
|
883
|
+
<p className="mt-4 text-xs text-muted/60">
|
|
884
|
+
{t("elizaclouddashboard.NewToElizaCloud")}{" "}
|
|
885
|
+
<a
|
|
886
|
+
href={ELIZA_CLOUD_LOGIN_URL}
|
|
887
|
+
target="_blank"
|
|
888
|
+
rel="noopener noreferrer"
|
|
889
|
+
className="text-txt underline hover:text-txt-hover transition-colors"
|
|
890
|
+
>
|
|
891
|
+
{t("elizaclouddashboard.LearnMore")}
|
|
892
|
+
</a>
|
|
893
|
+
</p>
|
|
894
|
+
</div>
|
|
895
|
+
);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
return (
|
|
899
|
+
<div className="custom-scrollbar p-6 lg:p-10 space-y-8 max-w-7xl mx-auto animate-in fade-in duration-500">
|
|
900
|
+
<div className="flex flex-col md:flex-row md:items-end justify-between gap-6">
|
|
901
|
+
<div>
|
|
902
|
+
<div className="flex items-center gap-3 mb-2">
|
|
903
|
+
<div className="w-10 h-10 rounded-xl bg-accent flex items-center justify-center shadow-lg shadow-accent/20">
|
|
904
|
+
<LayoutDashboard className="w-5 h-5 text-accent-fg" />
|
|
905
|
+
</div>
|
|
906
|
+
<h1 className="text-3xl font-bold text-txt-strong tracking-tight">
|
|
907
|
+
{t("elizaclouddashboard.CloudDashboard")}
|
|
908
|
+
</h1>
|
|
909
|
+
</div>
|
|
910
|
+
<p className="text-muted">
|
|
911
|
+
{t("elizaclouddashboard.ManageInstance")}
|
|
912
|
+
</p>
|
|
913
|
+
</div>
|
|
914
|
+
|
|
915
|
+
<div className="flex items-center gap-3">
|
|
916
|
+
<div className="inline-flex items-center gap-1 rounded-2xl border border-border/50 bg-bg/50 p-1">
|
|
917
|
+
<button
|
|
918
|
+
type="button"
|
|
919
|
+
className={`inline-flex items-center gap-2 rounded-xl px-3 py-2 text-sm font-medium transition-colors ${
|
|
920
|
+
activeView === "billing"
|
|
921
|
+
? "bg-accent text-accent-fg"
|
|
922
|
+
: "text-muted hover:text-txt"
|
|
923
|
+
}`}
|
|
924
|
+
onClick={() => setState("cloudDashboardView", "billing")}
|
|
925
|
+
>
|
|
926
|
+
<CircleDollarSign className="w-4 h-4" />
|
|
927
|
+
{t("elizaclouddashboard.CloudBilling")}
|
|
928
|
+
</button>
|
|
929
|
+
<button
|
|
930
|
+
type="button"
|
|
931
|
+
className={`inline-flex items-center gap-2 rounded-xl px-3 py-2 text-sm font-medium transition-colors ${
|
|
932
|
+
activeView === "agents"
|
|
933
|
+
? "bg-accent text-accent-fg"
|
|
934
|
+
: "text-muted hover:text-txt"
|
|
935
|
+
}`}
|
|
936
|
+
onClick={() => setState("cloudDashboardView", "agents")}
|
|
937
|
+
>
|
|
938
|
+
<Server className="w-4 h-4" />
|
|
939
|
+
{t("elizaclouddashboard.CloudAgents")}
|
|
940
|
+
</button>
|
|
941
|
+
</div>
|
|
942
|
+
<Button
|
|
943
|
+
variant="outline"
|
|
944
|
+
size="sm"
|
|
945
|
+
className="rounded-xl border-border/50 bg-bg/50 backdrop-blur-sm"
|
|
946
|
+
onClick={handleRefresh}
|
|
947
|
+
disabled={refreshing}
|
|
948
|
+
>
|
|
949
|
+
<RefreshCw
|
|
950
|
+
className={`w-4 h-4 mr-2 ${refreshing ? "animate-spin" : ""}`}
|
|
951
|
+
/>
|
|
952
|
+
{t("elizaclouddashboard.Refresh")}
|
|
953
|
+
</Button>
|
|
954
|
+
<Button
|
|
955
|
+
variant="outline"
|
|
956
|
+
size="sm"
|
|
957
|
+
className="rounded-xl border-danger/30 text-danger hover:bg-danger/10"
|
|
958
|
+
onClick={handleCloudDisconnect}
|
|
959
|
+
disabled={cloudDisconnecting}
|
|
960
|
+
>
|
|
961
|
+
{cloudDisconnecting
|
|
962
|
+
? t("elizaclouddashboard.Disconnecting")
|
|
963
|
+
: t("elizaclouddashboard.Disconnect")}
|
|
964
|
+
</Button>
|
|
965
|
+
</div>
|
|
966
|
+
</div>
|
|
967
|
+
|
|
968
|
+
{activeView === "billing" ? (
|
|
969
|
+
<div className="grid grid-cols-1 xl:grid-cols-[minmax(0,1.8fr)_minmax(320px,1fr)] gap-8">
|
|
970
|
+
<div className="space-y-8">
|
|
971
|
+
<SectionCard
|
|
972
|
+
title={t("elizaclouddashboard.CloudBilling")}
|
|
973
|
+
description={t("elizaclouddashboard.CloudBillingDesc")}
|
|
974
|
+
className="border-border/50 bg-bg/40 backdrop-blur-xl rounded-3xl shadow-sm"
|
|
975
|
+
>
|
|
976
|
+
{billingError && (
|
|
977
|
+
<div className="mt-4 rounded-2xl border border-danger/30 bg-danger/10 px-4 py-3 text-sm text-danger">
|
|
978
|
+
{billingError}
|
|
979
|
+
</div>
|
|
980
|
+
)}
|
|
981
|
+
|
|
982
|
+
<div className="mt-4 grid grid-cols-1 gap-4 xl:grid-cols-[minmax(0,1.1fr)_minmax(320px,0.9fr)]">
|
|
983
|
+
<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">
|
|
984
|
+
<div className="flex items-start justify-between gap-4">
|
|
985
|
+
<div>
|
|
986
|
+
<div className="text-[11px] uppercase tracking-[0.18em] text-muted">
|
|
987
|
+
{t("elizaclouddashboard.AvailableBalance")}
|
|
988
|
+
</div>
|
|
989
|
+
<div
|
|
990
|
+
className={`mt-3 text-4xl font-bold tracking-tight sm:text-5xl ${creditStatusColor}`}
|
|
991
|
+
>
|
|
992
|
+
{cloudCurrency === "USD" ? "$" : `${cloudCurrency} `}
|
|
993
|
+
{cloudBalance.toFixed(2)}
|
|
994
|
+
</div>
|
|
995
|
+
<div className="mt-3 text-sm text-muted">
|
|
996
|
+
{t("elizaclouddashboard.InAppBillingReady")}
|
|
997
|
+
</div>
|
|
998
|
+
</div>
|
|
999
|
+
<div className="flex items-center gap-2">
|
|
1000
|
+
{billingLoading ? (
|
|
1001
|
+
<Loader2 className="h-4 w-4 animate-spin text-muted" />
|
|
1002
|
+
) : null}
|
|
1003
|
+
<span
|
|
1004
|
+
className={`rounded-full border px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.18em] ${
|
|
1005
|
+
summaryCritical
|
|
1006
|
+
? "border-danger/30 bg-danger/10 text-danger"
|
|
1007
|
+
: summaryLow
|
|
1008
|
+
? "border-warn/30 bg-warn/10 text-warn"
|
|
1009
|
+
: "border-ok/30 bg-ok/10 text-ok"
|
|
1010
|
+
}`}
|
|
1011
|
+
>
|
|
1012
|
+
{creditStatusTone}
|
|
1013
|
+
</span>
|
|
1014
|
+
</div>
|
|
1015
|
+
</div>
|
|
1016
|
+
|
|
1017
|
+
<div className="mt-6 grid grid-cols-1 gap-3 sm:grid-cols-2">
|
|
1018
|
+
<div className="rounded-2xl border border-border/40 bg-bg/30 px-4 py-3">
|
|
1019
|
+
<div className="text-[11px] uppercase tracking-[0.18em] text-muted">
|
|
1020
|
+
{t("elizaclouddashboard.TopUpCredits")}
|
|
1021
|
+
</div>
|
|
1022
|
+
<div className="mt-2 text-sm text-txt-strong">
|
|
1023
|
+
{t("elizaclouddashboard.MinimumTopUp", {
|
|
1024
|
+
amount: minimumTopUp.toFixed(2),
|
|
1025
|
+
})}
|
|
1026
|
+
</div>
|
|
1027
|
+
</div>
|
|
1028
|
+
<div className="rounded-2xl border border-border/40 bg-bg/30 px-4 py-3">
|
|
1029
|
+
<div className="text-[11px] uppercase tracking-[0.18em] text-muted">
|
|
1030
|
+
{t("elizaclouddashboard.AutoTopUp")}
|
|
1031
|
+
</div>
|
|
1032
|
+
<div className="mt-2 text-sm text-txt-strong">
|
|
1033
|
+
{autoTopUpEnabled
|
|
1034
|
+
? t("elizaclouddashboard.Enabled")
|
|
1035
|
+
: t("elizaclouddashboard.Disabled")}
|
|
1036
|
+
</div>
|
|
1037
|
+
</div>
|
|
1038
|
+
</div>
|
|
1039
|
+
</div>
|
|
1040
|
+
|
|
1041
|
+
<div className="rounded-[28px] border border-border/50 bg-bg/25 p-5 sm:p-6">
|
|
1042
|
+
<div className="flex items-start justify-between gap-4">
|
|
1043
|
+
<div>
|
|
1044
|
+
<div className="text-sm font-semibold text-txt-strong">
|
|
1045
|
+
{t("elizaclouddashboard.AutoTopUp")}
|
|
1046
|
+
</div>
|
|
1047
|
+
<div className="mt-1 text-sm text-muted">
|
|
1048
|
+
{t("elizaclouddashboard.AutoTopUpDesc")}
|
|
1049
|
+
</div>
|
|
1050
|
+
</div>
|
|
1051
|
+
<button
|
|
1052
|
+
type="button"
|
|
1053
|
+
onClick={() =>
|
|
1054
|
+
dispatchAutoTopUpForm({
|
|
1055
|
+
type: "setEnabled",
|
|
1056
|
+
value: !autoTopUpEnabled,
|
|
1057
|
+
})
|
|
1058
|
+
}
|
|
1059
|
+
className={`relative inline-flex h-7 w-12 items-center rounded-full border transition-colors ${
|
|
1060
|
+
autoTopUpEnabled
|
|
1061
|
+
? "border-accent bg-accent"
|
|
1062
|
+
: "border-border/60 bg-bg/50"
|
|
1063
|
+
}`}
|
|
1064
|
+
aria-label={t("elizaclouddashboard.ToggleAutoTopUp")}
|
|
1065
|
+
>
|
|
1066
|
+
<span
|
|
1067
|
+
className={`inline-block h-5 w-5 rounded-full bg-white transition-transform ${
|
|
1068
|
+
autoTopUpEnabled ? "translate-x-6" : "translate-x-1"
|
|
1069
|
+
}`}
|
|
1070
|
+
/>
|
|
1071
|
+
</button>
|
|
1072
|
+
</div>
|
|
1073
|
+
|
|
1074
|
+
<div className="mt-4 rounded-2xl border border-border/40 bg-bg/20 px-4 py-3 text-sm text-muted">
|
|
1075
|
+
{autoTopUpHasPaymentMethod
|
|
1076
|
+
? t("elizaclouddashboard.AutoTopUpPaymentReady")
|
|
1077
|
+
: t("elizaclouddashboard.AutoTopUpNeedsPaymentMethod")}
|
|
1078
|
+
</div>
|
|
1079
|
+
|
|
1080
|
+
<div className="mt-4 grid grid-cols-1 gap-3 sm:grid-cols-2">
|
|
1081
|
+
<div className="space-y-2">
|
|
1082
|
+
<label
|
|
1083
|
+
htmlFor="cloud-auto-topup-threshold"
|
|
1084
|
+
className="text-xs font-medium text-muted"
|
|
1085
|
+
>
|
|
1086
|
+
{t("elizaclouddashboard.AutoTopUpThreshold")}
|
|
1087
|
+
</label>
|
|
1088
|
+
<Input
|
|
1089
|
+
id="cloud-auto-topup-threshold"
|
|
1090
|
+
type="number"
|
|
1091
|
+
min={String(autoTopUpMinThreshold)}
|
|
1092
|
+
max={String(autoTopUpMaxThreshold)}
|
|
1093
|
+
step="1"
|
|
1094
|
+
value={autoTopUpThreshold}
|
|
1095
|
+
onChange={(event) =>
|
|
1096
|
+
dispatchAutoTopUpForm({
|
|
1097
|
+
type: "setThreshold",
|
|
1098
|
+
value: event.target.value,
|
|
1099
|
+
})
|
|
1100
|
+
}
|
|
1101
|
+
className="rounded-xl bg-bg"
|
|
1102
|
+
/>
|
|
1103
|
+
</div>
|
|
1104
|
+
<div className="space-y-2">
|
|
1105
|
+
<label
|
|
1106
|
+
htmlFor="cloud-auto-topup-amount"
|
|
1107
|
+
className="text-xs font-medium text-muted"
|
|
1108
|
+
>
|
|
1109
|
+
{t("elizaclouddashboard.AutoTopUpAmount")}
|
|
1110
|
+
</label>
|
|
1111
|
+
<Input
|
|
1112
|
+
id="cloud-auto-topup-amount"
|
|
1113
|
+
type="number"
|
|
1114
|
+
min={String(autoTopUpMinAmount)}
|
|
1115
|
+
max={String(autoTopUpMaxAmount)}
|
|
1116
|
+
step="1"
|
|
1117
|
+
value={autoTopUpAmount}
|
|
1118
|
+
onChange={(event) =>
|
|
1119
|
+
dispatchAutoTopUpForm({
|
|
1120
|
+
type: "setAmount",
|
|
1121
|
+
value: event.target.value,
|
|
1122
|
+
})
|
|
1123
|
+
}
|
|
1124
|
+
className="rounded-xl bg-bg"
|
|
1125
|
+
/>
|
|
1126
|
+
</div>
|
|
1127
|
+
</div>
|
|
1128
|
+
|
|
1129
|
+
<div className="mt-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
|
1130
|
+
<div className="text-xs text-muted">
|
|
1131
|
+
{t("elizaclouddashboard.AutoTopUpLimits", {
|
|
1132
|
+
minAmount: autoTopUpMinAmount,
|
|
1133
|
+
maxAmount: autoTopUpMaxAmount,
|
|
1134
|
+
minThreshold: autoTopUpMinThreshold,
|
|
1135
|
+
maxThreshold: autoTopUpMaxThreshold,
|
|
1136
|
+
})}
|
|
1137
|
+
</div>
|
|
1138
|
+
<Button
|
|
1139
|
+
variant="outline"
|
|
1140
|
+
className="rounded-2xl border-border/50"
|
|
1141
|
+
disabled={
|
|
1142
|
+
billingSettingsBusy ||
|
|
1143
|
+
billingLoading ||
|
|
1144
|
+
!autoTopUpForm.dirty
|
|
1145
|
+
}
|
|
1146
|
+
onClick={() => void handleSaveBillingSettings()}
|
|
1147
|
+
>
|
|
1148
|
+
{billingSettingsBusy ? (
|
|
1149
|
+
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
|
1150
|
+
) : null}
|
|
1151
|
+
{t("elizaclouddashboard.SaveBillingSettings")}
|
|
1152
|
+
</Button>
|
|
1153
|
+
</div>
|
|
1154
|
+
</div>
|
|
1155
|
+
</div>
|
|
1156
|
+
|
|
1157
|
+
<div className="mt-6 rounded-[28px] border border-border/50 bg-bg/25 p-5 sm:p-6">
|
|
1158
|
+
<div className="flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between">
|
|
1159
|
+
<div>
|
|
1160
|
+
<div className="text-sm font-semibold text-txt-strong">
|
|
1161
|
+
{t("elizaclouddashboard.TopUpCredits")}
|
|
1162
|
+
</div>
|
|
1163
|
+
<div className="mt-1 text-sm text-muted">
|
|
1164
|
+
{t("elizaclouddashboard.TopUpCreditsDesc")}
|
|
1165
|
+
</div>
|
|
1166
|
+
</div>
|
|
1167
|
+
|
|
1168
|
+
{fallbackBillingUrl ? (
|
|
1169
|
+
<Button
|
|
1170
|
+
variant="ghost"
|
|
1171
|
+
className="justify-start rounded-2xl px-0 text-sm text-muted hover:text-txt"
|
|
1172
|
+
onClick={() => void openExternalUrl(fallbackBillingUrl)}
|
|
1173
|
+
>
|
|
1174
|
+
<ExternalLink className="mr-2 h-4 w-4" />
|
|
1175
|
+
{t("elizaclouddashboard.OpenBrowserBilling")}
|
|
1176
|
+
</Button>
|
|
1177
|
+
) : null}
|
|
1178
|
+
</div>
|
|
1179
|
+
|
|
1180
|
+
<div className="mt-5 grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(260px,0.8fr)]">
|
|
1181
|
+
<div className="space-y-3">
|
|
1182
|
+
<div className="flex flex-wrap gap-2">
|
|
1183
|
+
{BILLING_PRESET_AMOUNTS.map((amount) => (
|
|
1184
|
+
<button
|
|
1185
|
+
key={amount}
|
|
1186
|
+
type="button"
|
|
1187
|
+
className={`rounded-xl border px-3 py-2 text-sm font-medium transition-colors ${
|
|
1188
|
+
billingAmount === String(amount)
|
|
1189
|
+
? "border-accent bg-accent text-accent-fg"
|
|
1190
|
+
: "border-border/50 bg-bg/30 text-txt hover:border-accent/40"
|
|
1191
|
+
}`}
|
|
1192
|
+
onClick={() => setBillingAmount(String(amount))}
|
|
1193
|
+
>
|
|
1194
|
+
${amount}
|
|
1195
|
+
</button>
|
|
1196
|
+
))}
|
|
1197
|
+
</div>
|
|
1198
|
+
|
|
1199
|
+
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
|
|
1200
|
+
<div className="space-y-2">
|
|
1201
|
+
<label
|
|
1202
|
+
htmlFor="cloud-billing-amount"
|
|
1203
|
+
className="text-xs font-medium text-muted"
|
|
1204
|
+
>
|
|
1205
|
+
{t("elizaclouddashboard.CustomAmount")}
|
|
1206
|
+
</label>
|
|
1207
|
+
<Input
|
|
1208
|
+
id="cloud-billing-amount"
|
|
1209
|
+
type="number"
|
|
1210
|
+
min={String(minimumTopUp)}
|
|
1211
|
+
step="1"
|
|
1212
|
+
value={billingAmount}
|
|
1213
|
+
onChange={(event) =>
|
|
1214
|
+
setBillingAmount(event.target.value)
|
|
1215
|
+
}
|
|
1216
|
+
className="rounded-xl bg-bg"
|
|
1217
|
+
/>
|
|
1218
|
+
</div>
|
|
1219
|
+
<div className="rounded-2xl border border-border/40 bg-bg/20 px-4 py-3 text-sm text-muted">
|
|
1220
|
+
{t("elizaclouddashboard.MinimumTopUp", {
|
|
1221
|
+
amount: minimumTopUp.toFixed(2),
|
|
1222
|
+
})}
|
|
1223
|
+
</div>
|
|
1224
|
+
</div>
|
|
1225
|
+
</div>
|
|
1226
|
+
|
|
1227
|
+
<div className="flex flex-col gap-3">
|
|
1228
|
+
<Button
|
|
1229
|
+
variant="default"
|
|
1230
|
+
className="h-12 rounded-2xl font-semibold"
|
|
1231
|
+
disabled={checkoutBusy || billingLoading}
|
|
1232
|
+
onClick={() => void handleStartCheckout()}
|
|
1233
|
+
>
|
|
1234
|
+
{checkoutBusy ? (
|
|
1235
|
+
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
|
1236
|
+
) : (
|
|
1237
|
+
<CreditCard className="mr-2 h-4 w-4" />
|
|
1238
|
+
)}
|
|
1239
|
+
{t("elizaclouddashboard.PayWithCard")}
|
|
1240
|
+
</Button>
|
|
1241
|
+
<Button
|
|
1242
|
+
variant="outline"
|
|
1243
|
+
className="h-12 rounded-2xl border-border/50"
|
|
1244
|
+
disabled={cryptoBusy || billingLoading}
|
|
1245
|
+
onClick={() => void handleCreateCryptoQuote()}
|
|
1246
|
+
>
|
|
1247
|
+
{cryptoBusy ? (
|
|
1248
|
+
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
|
1249
|
+
) : (
|
|
1250
|
+
<Wallet className="mr-2 h-4 w-4" />
|
|
1251
|
+
)}
|
|
1252
|
+
{t("elizaclouddashboard.PayWithCrypto")}
|
|
1253
|
+
</Button>
|
|
1254
|
+
<div className="rounded-2xl border border-border/40 bg-bg/20 px-4 py-3 text-xs text-muted">
|
|
1255
|
+
{t("elizaclouddashboard.CheckoutProviderNote")}
|
|
1256
|
+
</div>
|
|
1257
|
+
</div>
|
|
1258
|
+
</div>
|
|
1259
|
+
</div>
|
|
1260
|
+
</SectionCard>
|
|
1261
|
+
</div>
|
|
1262
|
+
|
|
1263
|
+
<div className="space-y-8">
|
|
1264
|
+
<SectionCard
|
|
1265
|
+
title={t("elizaclouddashboard.CryptoTopUp")}
|
|
1266
|
+
description={t("elizaclouddashboard.CryptoTopUpDesc")}
|
|
1267
|
+
className="border-border/50 bg-bg/40 backdrop-blur-xl rounded-3xl shadow-sm"
|
|
1268
|
+
>
|
|
1269
|
+
<div className="mt-2 space-y-4">
|
|
1270
|
+
<div className="rounded-2xl border border-border/40 bg-bg/25 px-4 py-3 text-sm text-muted">
|
|
1271
|
+
{hasAgentWallet
|
|
1272
|
+
? hasWalletFunds
|
|
1273
|
+
? t("elizaclouddashboard.AgentWalletFunded")
|
|
1274
|
+
: t("elizaclouddashboard.AgentWalletDetected")
|
|
1275
|
+
: t("elizaclouddashboard.NoAgentWalletDetected")}
|
|
1276
|
+
</div>
|
|
1277
|
+
|
|
1278
|
+
{cryptoQuote ? (
|
|
1279
|
+
<div className="rounded-2xl border border-border/40 bg-bg/25 p-4">
|
|
1280
|
+
<div className="space-y-2 text-sm">
|
|
1281
|
+
<div className="font-semibold text-txt-strong">
|
|
1282
|
+
{readString(cryptoQuote.provider) ??
|
|
1283
|
+
t("elizaclouddashboard.CryptoQuoteReady")}
|
|
1284
|
+
</div>
|
|
1285
|
+
<div className="text-muted">
|
|
1286
|
+
{readString(cryptoQuote.currency) ?? "USDC"}{" "}
|
|
1287
|
+
{readString(cryptoQuote.amount) ?? "0"} on{" "}
|
|
1288
|
+
{readString(cryptoQuote.network) ?? "selected network"}
|
|
1289
|
+
</div>
|
|
1290
|
+
{readString(cryptoQuote.payToAddress) && (
|
|
1291
|
+
<code className="block rounded-xl border border-border/40 bg-bg/30 px-3 py-2 text-xs text-txt-strong break-all">
|
|
1292
|
+
{readString(cryptoQuote.payToAddress)}
|
|
1293
|
+
</code>
|
|
1294
|
+
)}
|
|
1295
|
+
{readString(cryptoQuote.expiresAt) && (
|
|
1296
|
+
<div className="text-xs text-muted">
|
|
1297
|
+
Expires{" "}
|
|
1298
|
+
{new Date(
|
|
1299
|
+
readString(cryptoQuote.expiresAt) ?? "",
|
|
1300
|
+
).toLocaleString()}
|
|
1301
|
+
</div>
|
|
1302
|
+
)}
|
|
1303
|
+
</div>
|
|
1304
|
+
|
|
1305
|
+
<div className="mt-4 flex flex-col gap-3">
|
|
1306
|
+
{readString(cryptoQuote.paymentLinkUrl) ? (
|
|
1307
|
+
<Button
|
|
1308
|
+
variant="outline"
|
|
1309
|
+
className="rounded-2xl"
|
|
1310
|
+
onClick={() =>
|
|
1311
|
+
void openExternalUrl(
|
|
1312
|
+
readString(cryptoQuote.paymentLinkUrl) ?? "",
|
|
1313
|
+
)
|
|
1314
|
+
}
|
|
1315
|
+
>
|
|
1316
|
+
<ExternalLink className="mr-2 h-4 w-4" />
|
|
1317
|
+
{t("elizaclouddashboard.OpenHostedCryptoCheckout")}
|
|
1318
|
+
</Button>
|
|
1319
|
+
) : null}
|
|
1320
|
+
|
|
1321
|
+
<Button
|
|
1322
|
+
variant="default"
|
|
1323
|
+
className="rounded-2xl"
|
|
1324
|
+
disabled={
|
|
1325
|
+
cryptoPayBusy ||
|
|
1326
|
+
!hasAgentWallet ||
|
|
1327
|
+
!hasWalletFunds ||
|
|
1328
|
+
readString(cryptoQuote.network)?.toLowerCase() !==
|
|
1329
|
+
"bsc" ||
|
|
1330
|
+
!readString(cryptoQuote.payToAddress) ||
|
|
1331
|
+
!readString(cryptoQuote.amount)
|
|
1332
|
+
}
|
|
1333
|
+
onClick={() => void handlePayCryptoFromAgentWallet()}
|
|
1334
|
+
>
|
|
1335
|
+
{cryptoPayBusy ? (
|
|
1336
|
+
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
|
1337
|
+
) : (
|
|
1338
|
+
<Wallet className="mr-2 h-4 w-4" />
|
|
1339
|
+
)}
|
|
1340
|
+
{t("elizaclouddashboard.PayFromAgentWallet")}
|
|
1341
|
+
</Button>
|
|
1342
|
+
</div>
|
|
1343
|
+
</div>
|
|
1344
|
+
) : (
|
|
1345
|
+
<div className="rounded-2xl border border-dashed border-border/50 bg-bg/20 px-4 py-5 text-sm text-muted">
|
|
1346
|
+
{t("elizaclouddashboard.CryptoQuoteHint")}
|
|
1347
|
+
</div>
|
|
1348
|
+
)}
|
|
1349
|
+
|
|
1350
|
+
{cryptoPayResult && (
|
|
1351
|
+
<div className="rounded-2xl border border-ok/30 bg-ok/10 px-4 py-3 text-sm text-ok">
|
|
1352
|
+
{cryptoPayResult}
|
|
1353
|
+
</div>
|
|
1354
|
+
)}
|
|
1355
|
+
</div>
|
|
1356
|
+
</SectionCard>
|
|
1357
|
+
|
|
1358
|
+
<SectionCard
|
|
1359
|
+
title={t("elizaclouddashboard.AccountDetails")}
|
|
1360
|
+
className="border-border/50 bg-bg/40 backdrop-blur-xl rounded-3xl shadow-sm"
|
|
1361
|
+
>
|
|
1362
|
+
<div className="space-y-4 mt-2">
|
|
1363
|
+
<div className="p-3 rounded-2xl bg-bg/30 border border-border/30">
|
|
1364
|
+
<span className="text-[10px] text-muted uppercase font-bold tracking-wider mb-1 block">
|
|
1365
|
+
{t("elizaclouddashboard.CloudUserID")}
|
|
1366
|
+
</span>
|
|
1367
|
+
<code className="text-xs text-txt-strong break-all font-mono">
|
|
1368
|
+
{elizaCloudUserId || t("elizaclouddashboard.NotAvailable")}
|
|
1369
|
+
</code>
|
|
1370
|
+
</div>
|
|
1371
|
+
|
|
1372
|
+
<div className="flex items-center justify-between p-3">
|
|
1373
|
+
<div className="flex items-center gap-2">
|
|
1374
|
+
<Shield className="w-4 h-4 text-ok" />
|
|
1375
|
+
<span className="text-xs font-medium">
|
|
1376
|
+
{t("elizaclouddashboard.SecurityStatus")}
|
|
1377
|
+
</span>
|
|
1378
|
+
</div>
|
|
1379
|
+
<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">
|
|
1380
|
+
{t("elizaclouddashboard.Secure")}
|
|
1381
|
+
</span>
|
|
1382
|
+
</div>
|
|
1383
|
+
|
|
1384
|
+
<Button
|
|
1385
|
+
variant="link"
|
|
1386
|
+
className="settings-compact-button w-full text-xs text-txt justify-start px-3 h-auto"
|
|
1387
|
+
onClick={() =>
|
|
1388
|
+
void openExternalUrl(ELIZA_CLOUD_INSTANCES_URL)
|
|
1389
|
+
}
|
|
1390
|
+
>
|
|
1391
|
+
{t("elizaclouddashboard.AdvancedDashboard")}
|
|
1392
|
+
<ExternalLink className="w-3 h-3 ml-2" />
|
|
1393
|
+
</Button>
|
|
1394
|
+
</div>
|
|
1395
|
+
</SectionCard>
|
|
1396
|
+
</div>
|
|
1397
|
+
</div>
|
|
1398
|
+
) : (
|
|
1399
|
+
<div className="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
|
1400
|
+
<div className="lg:col-span-2 space-y-8">
|
|
1401
|
+
<SectionCard
|
|
1402
|
+
title={t("elizaclouddashboard.CloudAgents")}
|
|
1403
|
+
description={t("elizaclouddashboard.CloudAgentsDesc")}
|
|
1404
|
+
className="border-border/50 bg-bg/40 backdrop-blur-xl rounded-3xl overflow-hidden shadow-sm"
|
|
1405
|
+
>
|
|
1406
|
+
{agentsError && (
|
|
1407
|
+
<div className="mt-4 flex items-center gap-2 text-sm text-danger bg-danger/10 rounded-xl p-3 border border-danger/20">
|
|
1408
|
+
<AlertCircle className="w-4 h-4 shrink-0" />
|
|
1409
|
+
{agentsError}
|
|
1410
|
+
</div>
|
|
1411
|
+
)}
|
|
1412
|
+
|
|
1413
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4 mt-4">
|
|
1414
|
+
{agentsLoading && cloudAgents.length === 0 ? (
|
|
1415
|
+
<div className="col-span-full flex items-center justify-center py-12">
|
|
1416
|
+
<Loader2 className="w-6 h-6 text-txt animate-spin" />
|
|
1417
|
+
</div>
|
|
1418
|
+
) : (
|
|
1419
|
+
<>
|
|
1420
|
+
{cloudAgents.map((agent) => (
|
|
1421
|
+
<CloudAgentCard
|
|
1422
|
+
key={agent.agent_id}
|
|
1423
|
+
agent={agent}
|
|
1424
|
+
onDelete={handleDeleteAgent}
|
|
1425
|
+
deleting={deletingAgentId === agent.agent_id}
|
|
1426
|
+
launching={launchingAgentId === agent.agent_id}
|
|
1427
|
+
onLaunch={handleLaunchAgent}
|
|
1428
|
+
onSelect={(id) => setSelectedAgentId(id)}
|
|
1429
|
+
/>
|
|
1430
|
+
))}
|
|
1431
|
+
{showDeployForm ? (
|
|
1432
|
+
<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">
|
|
1433
|
+
<div className="w-full space-y-3">
|
|
1434
|
+
<input
|
|
1435
|
+
placeholder={t("elizaclouddashboard.AgentName")}
|
|
1436
|
+
value={deployAgentName}
|
|
1437
|
+
onChange={(e) => setDeployAgentName(e.target.value)}
|
|
1438
|
+
onKeyDown={(e) => {
|
|
1439
|
+
if (e.key === "Enter") void handleDeployAgent();
|
|
1440
|
+
if (e.key === "Escape") setShowDeployForm(false);
|
|
1441
|
+
}}
|
|
1442
|
+
disabled={deploying}
|
|
1443
|
+
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"
|
|
1444
|
+
/>
|
|
1445
|
+
<div className="flex gap-2">
|
|
1446
|
+
<Button
|
|
1447
|
+
variant="ghost"
|
|
1448
|
+
size="sm"
|
|
1449
|
+
className="flex-1 rounded-xl h-8 text-xs text-muted hover:text-txt-strong flex items-center justify-center p-0"
|
|
1450
|
+
onClick={() => setShowDeployForm(false)}
|
|
1451
|
+
disabled={deploying}
|
|
1452
|
+
>
|
|
1453
|
+
{t("onboarding.cancel")}
|
|
1454
|
+
</Button>
|
|
1455
|
+
<Button
|
|
1456
|
+
variant="default"
|
|
1457
|
+
size="sm"
|
|
1458
|
+
className="flex-1 rounded-xl h-8 text-xs font-bold"
|
|
1459
|
+
onClick={handleDeployAgent}
|
|
1460
|
+
disabled={deploying || !deployAgentName.trim()}
|
|
1461
|
+
>
|
|
1462
|
+
{deploying ? (
|
|
1463
|
+
<Loader2 className="w-3 h-3 animate-spin mx-auto" />
|
|
1464
|
+
) : (
|
|
1465
|
+
t("elizaclouddashboard.Deploy")
|
|
1466
|
+
)}
|
|
1467
|
+
</Button>
|
|
1468
|
+
</div>
|
|
1469
|
+
</div>
|
|
1470
|
+
</div>
|
|
1471
|
+
) : (
|
|
1472
|
+
<button
|
|
1473
|
+
type="button"
|
|
1474
|
+
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"
|
|
1475
|
+
onClick={() => setShowDeployForm(true)}
|
|
1476
|
+
>
|
|
1477
|
+
<div className="w-12 h-12 rounded-full bg-bg-accent flex items-center justify-center mb-4 group-hover:scale-110 transition-transform">
|
|
1478
|
+
<Plus className="w-6 h-6 text-muted group-hover:text-txt" />
|
|
1479
|
+
</div>
|
|
1480
|
+
<h3 className="font-bold text-txt-strong mb-1">
|
|
1481
|
+
{t("elizaclouddashboard.DeployNewAgent")}
|
|
1482
|
+
</h3>
|
|
1483
|
+
<p className="text-xs text-muted">
|
|
1484
|
+
{t("elizaclouddashboard.InitializeInstance")}
|
|
1485
|
+
</p>
|
|
1486
|
+
</button>
|
|
1487
|
+
)}
|
|
1488
|
+
</>
|
|
1489
|
+
)}
|
|
1490
|
+
</div>
|
|
1491
|
+
</SectionCard>
|
|
1492
|
+
|
|
1493
|
+
<SectionCard
|
|
1494
|
+
title={t("elizaclouddashboard.UsageMetrics")}
|
|
1495
|
+
description={t("elizaclouddashboard.UsageMetricsDesc")}
|
|
1496
|
+
className="border-border/50 bg-bg/40 backdrop-blur-xl rounded-3xl shadow-sm"
|
|
1497
|
+
>
|
|
1498
|
+
<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">
|
|
1499
|
+
{t("elizaclouddashboard.MetricsPlaceholder")}
|
|
1500
|
+
</div>
|
|
1501
|
+
</SectionCard>
|
|
1502
|
+
</div>
|
|
1503
|
+
|
|
1504
|
+
<div className="space-y-8">
|
|
1505
|
+
{selectedAgentId && selectedAgent ? (
|
|
1506
|
+
<AgentDetailSidebar
|
|
1507
|
+
agent={selectedAgent}
|
|
1508
|
+
onClose={() => setSelectedAgentId(null)}
|
|
1509
|
+
/>
|
|
1510
|
+
) : (
|
|
1511
|
+
<SectionCard
|
|
1512
|
+
title={t("elizaclouddashboard.AccountDetails")}
|
|
1513
|
+
className="border-border/50 bg-bg/40 backdrop-blur-xl rounded-3xl shadow-sm"
|
|
1514
|
+
>
|
|
1515
|
+
<div className="space-y-4 mt-2">
|
|
1516
|
+
<div className="p-3 rounded-2xl bg-bg/30 border border-border/30">
|
|
1517
|
+
<span className="text-[10px] text-muted uppercase font-bold tracking-wider mb-1 block">
|
|
1518
|
+
{t("elizaclouddashboard.CloudUserID")}
|
|
1519
|
+
</span>
|
|
1520
|
+
<code className="text-xs text-txt-strong break-all font-mono">
|
|
1521
|
+
{elizaCloudUserId ||
|
|
1522
|
+
t("elizaclouddashboard.NotAvailable")}
|
|
1523
|
+
</code>
|
|
1524
|
+
</div>
|
|
1525
|
+
|
|
1526
|
+
<div className="rounded-2xl border border-accent/20 bg-accent/8 p-4">
|
|
1527
|
+
<div className="text-[11px] uppercase tracking-[0.18em] text-muted">
|
|
1528
|
+
{t("elizaclouddashboard.AvailableBalance")}
|
|
1529
|
+
</div>
|
|
1530
|
+
<div
|
|
1531
|
+
className={`mt-2 text-3xl font-bold ${creditStatusColor}`}
|
|
1532
|
+
>
|
|
1533
|
+
${cloudBalance.toFixed(2)}
|
|
1534
|
+
</div>
|
|
1535
|
+
<div className="mt-2 text-xs text-muted">
|
|
1536
|
+
{creditStatusTone}
|
|
1537
|
+
</div>
|
|
1538
|
+
</div>
|
|
1539
|
+
|
|
1540
|
+
<Button
|
|
1541
|
+
variant="outline"
|
|
1542
|
+
className="w-full justify-start rounded-2xl border-border/40 bg-bg/30 px-4 py-3 text-sm"
|
|
1543
|
+
onClick={() => setState("cloudDashboardView", "billing")}
|
|
1544
|
+
>
|
|
1545
|
+
<CircleDollarSign className="mr-2 h-4 w-4" />
|
|
1546
|
+
{t("elizaclouddashboard.CloudBilling")}
|
|
1547
|
+
</Button>
|
|
1548
|
+
</div>
|
|
1549
|
+
</SectionCard>
|
|
1550
|
+
)}
|
|
1551
|
+
</div>
|
|
1552
|
+
</div>
|
|
1553
|
+
)}
|
|
1554
|
+
|
|
1555
|
+
<Dialog
|
|
1556
|
+
open={checkoutDialogOpen}
|
|
1557
|
+
onOpenChange={(open) => {
|
|
1558
|
+
setCheckoutDialogOpen(open);
|
|
1559
|
+
if (!open) {
|
|
1560
|
+
void fetchBillingData();
|
|
1561
|
+
}
|
|
1562
|
+
}}
|
|
1563
|
+
>
|
|
1564
|
+
<DialogContent className="max-w-4xl">
|
|
1565
|
+
<DialogHeader>
|
|
1566
|
+
<DialogTitle>{t("elizaclouddashboard.PayWithCard")}</DialogTitle>
|
|
1567
|
+
</DialogHeader>
|
|
1568
|
+
{checkoutSession?.clientSecret && checkoutSession.publishableKey ? (
|
|
1569
|
+
<StripeEmbeddedCheckout
|
|
1570
|
+
publishableKey={checkoutSession.publishableKey}
|
|
1571
|
+
clientSecret={checkoutSession.clientSecret}
|
|
1572
|
+
/>
|
|
1573
|
+
) : (
|
|
1574
|
+
<div className="rounded-2xl border border-border/40 bg-bg/25 px-4 py-5 text-sm text-muted">
|
|
1575
|
+
{t("elizaclouddashboard.CheckoutProviderNote")}
|
|
1576
|
+
</div>
|
|
1577
|
+
)}
|
|
1578
|
+
</DialogContent>
|
|
1579
|
+
</Dialog>
|
|
1580
|
+
</div>
|
|
1581
|
+
);
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
interface StatusDetail {
|
|
1585
|
+
status?: string;
|
|
1586
|
+
databaseStatus?: string;
|
|
1587
|
+
lastHeartbeat?: string | number | Date | null;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
function AgentDetailSidebar({
|
|
1591
|
+
agent,
|
|
1592
|
+
onClose,
|
|
1593
|
+
}: {
|
|
1594
|
+
agent: CloudCompatAgent | undefined;
|
|
1595
|
+
onClose: () => void;
|
|
1596
|
+
}) {
|
|
1597
|
+
const [logs, setLogs] = useState<string>("");
|
|
1598
|
+
const [statusDetail, setStatusDetail] = useState<StatusDetail | null>(null);
|
|
1599
|
+
const logsEndRef = useRef<HTMLDivElement>(null);
|
|
1600
|
+
|
|
1601
|
+
useEffect(() => {
|
|
1602
|
+
if (!agent) return;
|
|
1603
|
+
let mounted = true;
|
|
1604
|
+
|
|
1605
|
+
const fetchDetails = async () => {
|
|
1606
|
+
try {
|
|
1607
|
+
const [statusRes, logsRes] = await Promise.all([
|
|
1608
|
+
client.getCloudCompatAgentStatus(agent.agent_id),
|
|
1609
|
+
client.getCloudCompatAgentLogs(agent.agent_id, 100),
|
|
1610
|
+
]);
|
|
1611
|
+
|
|
1612
|
+
if (!mounted) return;
|
|
1613
|
+
setStatusDetail(statusRes.data);
|
|
1614
|
+
setLogs(typeof logsRes.data === "string" ? logsRes.data : "");
|
|
1615
|
+
} catch {
|
|
1616
|
+
// Silently retry next tick
|
|
1617
|
+
}
|
|
1618
|
+
};
|
|
1619
|
+
|
|
1620
|
+
void fetchDetails();
|
|
1621
|
+
const intId = setInterval(fetchDetails, 5000);
|
|
1622
|
+
return () => {
|
|
1623
|
+
mounted = false;
|
|
1624
|
+
clearInterval(intId);
|
|
1625
|
+
};
|
|
1626
|
+
}, [agent]);
|
|
1627
|
+
|
|
1628
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: rerun when logs update
|
|
1629
|
+
useEffect(() => {
|
|
1630
|
+
if (logsEndRef.current) {
|
|
1631
|
+
logsEndRef.current.scrollIntoView({ behavior: "smooth" });
|
|
1632
|
+
}
|
|
1633
|
+
}, [logs]);
|
|
1634
|
+
|
|
1635
|
+
if (!agent) return null;
|
|
1636
|
+
|
|
1637
|
+
return (
|
|
1638
|
+
<div className="space-y-4 animate-in slide-in-from-right-8 duration-300">
|
|
1639
|
+
<SectionCard
|
|
1640
|
+
title="Agent Details"
|
|
1641
|
+
className="border-accent/40 bg-accent/5 backdrop-blur-xl rounded-3xl shadow-sm relative overflow-hidden"
|
|
1642
|
+
>
|
|
1643
|
+
<button
|
|
1644
|
+
type="button"
|
|
1645
|
+
className="absolute top-4 right-4 p-1 rounded-full hover:bg-bg/50 transition-colors text-muted hover:text-txt-strong"
|
|
1646
|
+
onClick={onClose}
|
|
1647
|
+
>
|
|
1648
|
+
<X className="w-5 h-5" />
|
|
1649
|
+
</button>
|
|
1650
|
+
|
|
1651
|
+
<div className="mt-4 space-y-4">
|
|
1652
|
+
<div className="grid grid-cols-2 gap-4">
|
|
1653
|
+
<div className="p-3 rounded-xl bg-bg/40 border border-border/40">
|
|
1654
|
+
<span className="text-[10px] text-muted uppercase font-bold tracking-wider mb-1 block">
|
|
1655
|
+
Status
|
|
1656
|
+
</span>
|
|
1657
|
+
<AgentStatusBadge status={statusDetail?.status || agent.status} />
|
|
1658
|
+
</div>
|
|
1659
|
+
<div className="p-3 rounded-xl bg-bg/40 border border-border/40">
|
|
1660
|
+
<span className="text-[10px] text-muted uppercase font-bold tracking-wider mb-1 block">
|
|
1661
|
+
DB Status
|
|
1662
|
+
</span>
|
|
1663
|
+
<span className="text-xs font-mono">
|
|
1664
|
+
{statusDetail?.databaseStatus || agent.database_status || "—"}
|
|
1665
|
+
</span>
|
|
1666
|
+
</div>
|
|
1667
|
+
<div className="p-3 rounded-xl bg-bg/40 border border-border/40 col-span-2">
|
|
1668
|
+
<span className="text-[10px] text-muted uppercase font-bold tracking-wider mb-1 block">
|
|
1669
|
+
Heartbeat
|
|
1670
|
+
</span>
|
|
1671
|
+
<span className="text-xs font-mono">
|
|
1672
|
+
{statusDetail?.lastHeartbeat
|
|
1673
|
+
? new Date(statusDetail.lastHeartbeat).toLocaleString()
|
|
1674
|
+
: agent.last_heartbeat_at
|
|
1675
|
+
? new Date(agent.last_heartbeat_at).toLocaleString()
|
|
1676
|
+
: "No heartbeat yet"}
|
|
1677
|
+
</span>
|
|
1678
|
+
</div>
|
|
1679
|
+
</div>
|
|
1680
|
+
|
|
1681
|
+
<div className="p-3 rounded-xl bg-bg/80 border border-border/40">
|
|
1682
|
+
<span className="text-[10px] text-muted uppercase font-bold tracking-wider mb-2 flex items-center gap-2">
|
|
1683
|
+
<Terminal className="w-3 h-3" /> Live Logs
|
|
1684
|
+
</span>
|
|
1685
|
+
<div className="h-64 overflow-y-auto custom-scrollbar bg-black/50 rounded-lg p-3 border border-border/20">
|
|
1686
|
+
<pre className="text-[10px] font-mono text-txt-strong/80 whitespace-pre-wrap break-all">
|
|
1687
|
+
{logs || "No logs available. Deploying..."}
|
|
1688
|
+
<div ref={logsEndRef} />
|
|
1689
|
+
</pre>
|
|
1690
|
+
</div>
|
|
1691
|
+
</div>
|
|
1692
|
+
</div>
|
|
1693
|
+
</SectionCard>
|
|
1694
|
+
</div>
|
|
1695
|
+
);
|
|
1696
|
+
}
|