@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,1623 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Character view — roster-first character selection with optional customization.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
type CharacterData,
|
|
7
|
+
client,
|
|
8
|
+
type StylePreset,
|
|
9
|
+
type VoiceConfig,
|
|
10
|
+
} from "@elizaos/app-core/api";
|
|
11
|
+
import {
|
|
12
|
+
dispatchWindowEvent,
|
|
13
|
+
VOICE_CONFIG_UPDATED_EVENT,
|
|
14
|
+
} from "@elizaos/app-core/events";
|
|
15
|
+
import { getVrmPreviewUrl, useApp } from "@elizaos/app-core/state";
|
|
16
|
+
import {
|
|
17
|
+
PREMADE_VOICES,
|
|
18
|
+
sanitizeApiKey,
|
|
19
|
+
type VoicePreset,
|
|
20
|
+
} from "@elizaos/app-core/voice";
|
|
21
|
+
import { Button, Input, Textarea, ThemedSelect } from "@elizaos/ui";
|
|
22
|
+
import { Lock, LockOpen, Volume2, VolumeX } from "lucide-react";
|
|
23
|
+
import { useCallback, useEffect, useState } from "react";
|
|
24
|
+
|
|
25
|
+
const DEFAULT_ELEVEN_FAST_MODEL = "eleven_flash_v2_5";
|
|
26
|
+
|
|
27
|
+
type StyleSectionKey = "all" | "chat" | "post";
|
|
28
|
+
type CustomizeStep = "core" | "style" | "examples";
|
|
29
|
+
const STYLE_SECTION_KEYS: StyleSectionKey[] = ["all", "chat", "post"];
|
|
30
|
+
const STYLE_SECTION_PLACEHOLDERS: Record<StyleSectionKey, string> = {
|
|
31
|
+
all: "Add shared rule",
|
|
32
|
+
chat: "Add chat rule",
|
|
33
|
+
post: "Add post rule",
|
|
34
|
+
};
|
|
35
|
+
const STYLE_SECTION_EMPTY_STATES: Record<StyleSectionKey, string> = {
|
|
36
|
+
all: "No shared rules yet.",
|
|
37
|
+
chat: "No chat rules yet.",
|
|
38
|
+
post: "No post rules yet.",
|
|
39
|
+
};
|
|
40
|
+
const VOICE_SELECT_GROUPS = [
|
|
41
|
+
{
|
|
42
|
+
label: "Female",
|
|
43
|
+
items: PREMADE_VOICES.filter((preset) => preset.gender === "female").map(
|
|
44
|
+
(preset) => ({
|
|
45
|
+
id: preset.id,
|
|
46
|
+
text: preset.name,
|
|
47
|
+
}),
|
|
48
|
+
),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: "Male",
|
|
52
|
+
items: PREMADE_VOICES.filter((preset) => preset.gender === "male").map(
|
|
53
|
+
(preset) => ({
|
|
54
|
+
id: preset.id,
|
|
55
|
+
text: preset.name,
|
|
56
|
+
}),
|
|
57
|
+
),
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: "Character",
|
|
61
|
+
items: PREMADE_VOICES.filter((preset) => preset.gender === "character").map(
|
|
62
|
+
(preset) => ({
|
|
63
|
+
id: preset.id,
|
|
64
|
+
text: preset.name,
|
|
65
|
+
}),
|
|
66
|
+
),
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
const CHARACTER_PRESET_META: Record<
|
|
70
|
+
string,
|
|
71
|
+
{
|
|
72
|
+
name: string;
|
|
73
|
+
avatarIndex: number;
|
|
74
|
+
voicePresetId?: string;
|
|
75
|
+
}
|
|
76
|
+
> = {
|
|
77
|
+
"uwu~": { name: "Reimu", avatarIndex: 1, voicePresetId: "sarah" },
|
|
78
|
+
"hell yeah": { name: "Marisa", avatarIndex: 2, voicePresetId: "adam" },
|
|
79
|
+
"lol k": { name: "Yukari", avatarIndex: 3, voicePresetId: "liam" },
|
|
80
|
+
"Noted.": { name: "Sakuya", avatarIndex: 4, voicePresetId: "alice" },
|
|
81
|
+
"hehe~": { name: "Koishi", avatarIndex: 2, voicePresetId: "gigi" },
|
|
82
|
+
"...": { name: "Remilia", avatarIndex: 4, voicePresetId: "lily" },
|
|
83
|
+
"locked in": { name: "Reisen", avatarIndex: 3, voicePresetId: "josh" },
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
type CharacterRosterEntry = {
|
|
87
|
+
id: string;
|
|
88
|
+
name: string;
|
|
89
|
+
avatarIndex: number;
|
|
90
|
+
voicePresetId?: string;
|
|
91
|
+
preset: StylePreset;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
function replaceCharacterToken(value: string, name: string) {
|
|
95
|
+
return value.replaceAll("{{name}}", name).replaceAll("{{agentName}}", name);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function buildCharacterFromPreset(
|
|
99
|
+
preset: StylePreset,
|
|
100
|
+
name: string,
|
|
101
|
+
): CharacterData {
|
|
102
|
+
return {
|
|
103
|
+
name,
|
|
104
|
+
username: name,
|
|
105
|
+
bio: preset.bio.map((line) => replaceCharacterToken(line, name)),
|
|
106
|
+
system: replaceCharacterToken(preset.system, name),
|
|
107
|
+
adjectives: [...preset.adjectives],
|
|
108
|
+
style: {
|
|
109
|
+
all: [...preset.style.all],
|
|
110
|
+
chat: [...preset.style.chat],
|
|
111
|
+
post: [...preset.style.post],
|
|
112
|
+
},
|
|
113
|
+
messageExamples: preset.messageExamples.map((conversation) => ({
|
|
114
|
+
examples: conversation.map((message) => ({
|
|
115
|
+
name:
|
|
116
|
+
message.user === "{{agentName}}"
|
|
117
|
+
? name
|
|
118
|
+
: replaceCharacterToken(message.user, name),
|
|
119
|
+
content: {
|
|
120
|
+
text: replaceCharacterToken(message.content.text, name),
|
|
121
|
+
},
|
|
122
|
+
})),
|
|
123
|
+
})),
|
|
124
|
+
postExamples: preset.postExamples.map((example) =>
|
|
125
|
+
replaceCharacterToken(example, name),
|
|
126
|
+
),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function buildCharacterDraftFromPreset(
|
|
131
|
+
entry: CharacterRosterEntry,
|
|
132
|
+
): CharacterData {
|
|
133
|
+
const character = buildCharacterFromPreset(entry.preset, entry.name);
|
|
134
|
+
return {
|
|
135
|
+
name: character.name ?? "",
|
|
136
|
+
username: character.username ?? "",
|
|
137
|
+
bio: Array.isArray(character.bio)
|
|
138
|
+
? character.bio.join("\n")
|
|
139
|
+
: (character.bio ?? ""),
|
|
140
|
+
system: character.system ?? "",
|
|
141
|
+
adjectives: character.adjectives ?? [],
|
|
142
|
+
style: {
|
|
143
|
+
all: character.style?.all ?? [],
|
|
144
|
+
chat: character.style?.chat ?? [],
|
|
145
|
+
post: character.style?.post ?? [],
|
|
146
|
+
},
|
|
147
|
+
messageExamples: character.messageExamples ?? [],
|
|
148
|
+
postExamples: character.postExamples ?? [],
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function normalizeCharacterDraftForComparison(
|
|
153
|
+
character: CharacterData | null | undefined,
|
|
154
|
+
) {
|
|
155
|
+
return {
|
|
156
|
+
name: (character?.name ?? "").trim(),
|
|
157
|
+
username: (character?.username ?? "").trim(),
|
|
158
|
+
bio:
|
|
159
|
+
typeof character?.bio === "string"
|
|
160
|
+
? character.bio.trim()
|
|
161
|
+
: Array.isArray(character?.bio)
|
|
162
|
+
? character.bio.join("\n").trim()
|
|
163
|
+
: "",
|
|
164
|
+
system: (character?.system ?? "").trim(),
|
|
165
|
+
adjectives: [...(character?.adjectives ?? [])],
|
|
166
|
+
style: {
|
|
167
|
+
all: [...(character?.style?.all ?? [])],
|
|
168
|
+
chat: [...(character?.style?.chat ?? [])],
|
|
169
|
+
post: [...(character?.style?.post ?? [])],
|
|
170
|
+
},
|
|
171
|
+
messageExamples: (character?.messageExamples ?? []).map((conversation) => ({
|
|
172
|
+
examples: (conversation.examples ?? []).map((message) => ({
|
|
173
|
+
name: message.name,
|
|
174
|
+
content: {
|
|
175
|
+
text: message.content?.text ?? "",
|
|
176
|
+
},
|
|
177
|
+
})),
|
|
178
|
+
})),
|
|
179
|
+
postExamples: [...(character?.postExamples ?? [])],
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function characterDraftMatchesPreset(
|
|
184
|
+
character: CharacterData | null | undefined,
|
|
185
|
+
avatarIndex: number,
|
|
186
|
+
entry: CharacterRosterEntry,
|
|
187
|
+
) {
|
|
188
|
+
if (avatarIndex !== entry.avatarIndex) return false;
|
|
189
|
+
const normalizedCurrent = normalizeCharacterDraftForComparison(character);
|
|
190
|
+
const normalizedPreset = normalizeCharacterDraftForComparison(
|
|
191
|
+
buildCharacterDraftFromPreset(entry),
|
|
192
|
+
);
|
|
193
|
+
return JSON.stringify(normalizedCurrent) === JSON.stringify(normalizedPreset);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function resolveRosterEntries(
|
|
197
|
+
styles: readonly StylePreset[],
|
|
198
|
+
): CharacterRosterEntry[] {
|
|
199
|
+
return styles.map((preset, index) => {
|
|
200
|
+
const meta = CHARACTER_PRESET_META[preset.catchphrase];
|
|
201
|
+
const fallbackName = `Character ${index + 1}`;
|
|
202
|
+
return {
|
|
203
|
+
id: preset.catchphrase,
|
|
204
|
+
name: meta?.name ?? fallbackName,
|
|
205
|
+
avatarIndex: meta?.avatarIndex ?? (index % 4) + 1,
|
|
206
|
+
voicePresetId: meta?.voicePresetId,
|
|
207
|
+
preset,
|
|
208
|
+
};
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function findMatchingRosterEntry(
|
|
213
|
+
character: CharacterData | null,
|
|
214
|
+
avatarIndex: number,
|
|
215
|
+
roster: CharacterRosterEntry[],
|
|
216
|
+
) {
|
|
217
|
+
if (!character) return null;
|
|
218
|
+
const currentName =
|
|
219
|
+
typeof character.name === "string" ? character.name.trim() : "";
|
|
220
|
+
const exactNameMatch = roster.find((entry) => entry.name === currentName);
|
|
221
|
+
if (exactNameMatch) return exactNameMatch.id;
|
|
222
|
+
|
|
223
|
+
let bestMatch: { id: string; score: number } | null = null;
|
|
224
|
+
for (const entry of roster) {
|
|
225
|
+
let score = 0;
|
|
226
|
+
if (entry.avatarIndex === avatarIndex) score += 3;
|
|
227
|
+
|
|
228
|
+
const draftAdjectives = new Set(character.adjectives ?? []);
|
|
229
|
+
for (const adjective of entry.preset.adjectives) {
|
|
230
|
+
if (draftAdjectives.has(adjective)) score += 1;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (
|
|
234
|
+
typeof character.system === "string" &&
|
|
235
|
+
character.system.includes(entry.preset.catchphrase)
|
|
236
|
+
) {
|
|
237
|
+
score += 1;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (!bestMatch || score > bestMatch.score) {
|
|
241
|
+
bestMatch = { id: entry.id, score };
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return bestMatch && bestMatch.score >= 4 ? bestMatch.id : null;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function findExactRosterEntry(
|
|
249
|
+
character: CharacterData | null,
|
|
250
|
+
roster: CharacterRosterEntry[],
|
|
251
|
+
) {
|
|
252
|
+
if (!character) return null;
|
|
253
|
+
const currentName =
|
|
254
|
+
typeof character.name === "string" ? character.name.trim() : "";
|
|
255
|
+
return roster.find((entry) => entry.name === currentName) ?? null;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function hasCharacterContent(character: CharacterData | null | undefined) {
|
|
259
|
+
return Boolean(character && Object.keys(character).length > 0);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function resolveActiveRosterEntry(
|
|
263
|
+
character: CharacterData | null | undefined,
|
|
264
|
+
avatarIndex: number,
|
|
265
|
+
selectedCharacterId: string | null,
|
|
266
|
+
roster: CharacterRosterEntry[],
|
|
267
|
+
) {
|
|
268
|
+
if (selectedCharacterId) {
|
|
269
|
+
const selectedEntry =
|
|
270
|
+
roster.find((entry) => entry.id === selectedCharacterId) ?? null;
|
|
271
|
+
if (selectedEntry) return selectedEntry;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const exactEntry = findExactRosterEntry(character ?? null, roster);
|
|
275
|
+
if (exactEntry) return exactEntry;
|
|
276
|
+
|
|
277
|
+
const matchedId = findMatchingRosterEntry(
|
|
278
|
+
character ?? null,
|
|
279
|
+
avatarIndex,
|
|
280
|
+
roster,
|
|
281
|
+
);
|
|
282
|
+
if (!matchedId) return null;
|
|
283
|
+
return roster.find((entry) => entry.id === matchedId) ?? null;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function getStyleEntryRenderKey(
|
|
287
|
+
section: StyleSectionKey,
|
|
288
|
+
items: string[],
|
|
289
|
+
item: string,
|
|
290
|
+
index: number,
|
|
291
|
+
) {
|
|
292
|
+
let occurrence = 0;
|
|
293
|
+
for (const current of items.slice(0, index + 1)) {
|
|
294
|
+
if (current === item) occurrence += 1;
|
|
295
|
+
}
|
|
296
|
+
return `${section}:${item}:${occurrence}`;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/* ── CharacterView ──────────────────────────────────────────────────── */
|
|
300
|
+
|
|
301
|
+
export function CharacterView({
|
|
302
|
+
inModal,
|
|
303
|
+
sceneOverlay = false,
|
|
304
|
+
}: {
|
|
305
|
+
inModal?: boolean;
|
|
306
|
+
sceneOverlay?: boolean;
|
|
307
|
+
} = {}) {
|
|
308
|
+
const {
|
|
309
|
+
tab,
|
|
310
|
+
setTab,
|
|
311
|
+
characterData,
|
|
312
|
+
characterDraft,
|
|
313
|
+
characterLoading,
|
|
314
|
+
characterSaving,
|
|
315
|
+
characterSaveSuccess,
|
|
316
|
+
characterSaveError,
|
|
317
|
+
handleCharacterFieldInput,
|
|
318
|
+
handleCharacterArrayInput,
|
|
319
|
+
handleCharacterStyleInput,
|
|
320
|
+
handleSaveCharacter,
|
|
321
|
+
loadCharacter,
|
|
322
|
+
setState,
|
|
323
|
+
onboardingOptions,
|
|
324
|
+
selectedVrmIndex,
|
|
325
|
+
t,
|
|
326
|
+
// Registry / Drop
|
|
327
|
+
registryStatus,
|
|
328
|
+
registryLoading,
|
|
329
|
+
registryRegistering,
|
|
330
|
+
registryError,
|
|
331
|
+
dropStatus,
|
|
332
|
+
loadRegistryStatus,
|
|
333
|
+
registerOnChain,
|
|
334
|
+
syncRegistryProfile,
|
|
335
|
+
loadDropStatus,
|
|
336
|
+
walletConfig,
|
|
337
|
+
} = useApp();
|
|
338
|
+
|
|
339
|
+
useEffect(() => {
|
|
340
|
+
void loadCharacter();
|
|
341
|
+
void loadRegistryStatus();
|
|
342
|
+
void loadDropStatus();
|
|
343
|
+
}, [loadCharacter, loadRegistryStatus, loadDropStatus]);
|
|
344
|
+
|
|
345
|
+
const handleFieldEdit = useCallback(
|
|
346
|
+
<K extends keyof CharacterData>(field: K, value: CharacterData[K]) => {
|
|
347
|
+
handleCharacterFieldInput(field, value);
|
|
348
|
+
},
|
|
349
|
+
[handleCharacterFieldInput],
|
|
350
|
+
);
|
|
351
|
+
|
|
352
|
+
const handleStyleEdit = useCallback(
|
|
353
|
+
(key: "all" | "chat" | "post", value: string) => {
|
|
354
|
+
handleCharacterStyleInput(key, value);
|
|
355
|
+
},
|
|
356
|
+
[handleCharacterStyleInput],
|
|
357
|
+
);
|
|
358
|
+
|
|
359
|
+
/* ── Character generation state ─────────────────────────────────── */
|
|
360
|
+
const [generating, setGenerating] = useState<string | null>(null);
|
|
361
|
+
const [pendingStyleEntries, setPendingStyleEntries] = useState<
|
|
362
|
+
Record<StyleSectionKey, string>
|
|
363
|
+
>({
|
|
364
|
+
all: "",
|
|
365
|
+
chat: "",
|
|
366
|
+
post: "",
|
|
367
|
+
});
|
|
368
|
+
const [styleEntryDrafts, setStyleEntryDrafts] = useState<
|
|
369
|
+
Record<StyleSectionKey, string[]>
|
|
370
|
+
>({
|
|
371
|
+
all: [],
|
|
372
|
+
chat: [],
|
|
373
|
+
post: [],
|
|
374
|
+
});
|
|
375
|
+
const [customizeStep, setCustomizeStep] = useState<CustomizeStep>("core");
|
|
376
|
+
const [customOverridesEnabled, setCustomOverridesEnabled] = useState(false);
|
|
377
|
+
const [selectedCharacterId, setSelectedCharacterId] = useState<string | null>(
|
|
378
|
+
null,
|
|
379
|
+
);
|
|
380
|
+
const [rosterStyles, setRosterStyles] = useState<StylePreset[]>(
|
|
381
|
+
onboardingOptions?.styles ?? [],
|
|
382
|
+
);
|
|
383
|
+
|
|
384
|
+
/* ── Voice config state ─────────────────────────────────────────── */
|
|
385
|
+
const [voiceConfig, setVoiceConfig] = useState<VoiceConfig>({});
|
|
386
|
+
const [voiceLoading, setVoiceLoading] = useState(false);
|
|
387
|
+
const [voiceSaving, setVoiceSaving] = useState(false);
|
|
388
|
+
const [voiceSaveError, setVoiceSaveError] = useState<string | null>(null);
|
|
389
|
+
const [voiceTesting, setVoiceTesting] = useState(false);
|
|
390
|
+
const [voiceTestAudio, setVoiceTestAudio] = useState<HTMLAudioElement | null>(
|
|
391
|
+
null,
|
|
392
|
+
);
|
|
393
|
+
const [selectedVoicePresetId, setSelectedVoicePresetId] = useState<
|
|
394
|
+
string | null
|
|
395
|
+
>(null);
|
|
396
|
+
const [voiceSelectionLocked, setVoiceSelectionLocked] = useState(false);
|
|
397
|
+
|
|
398
|
+
useEffect(() => {
|
|
399
|
+
if (onboardingOptions?.styles?.length) {
|
|
400
|
+
setRosterStyles(onboardingOptions.styles);
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
let cancelled = false;
|
|
405
|
+
void client
|
|
406
|
+
.getOnboardingOptions()
|
|
407
|
+
.then((options) => {
|
|
408
|
+
if (!cancelled) {
|
|
409
|
+
setRosterStyles(options.styles ?? []);
|
|
410
|
+
}
|
|
411
|
+
})
|
|
412
|
+
.catch(() => {
|
|
413
|
+
/* ignore */
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
return () => {
|
|
417
|
+
cancelled = true;
|
|
418
|
+
};
|
|
419
|
+
}, [onboardingOptions?.styles]);
|
|
420
|
+
|
|
421
|
+
const characterRoster = resolveRosterEntries(rosterStyles);
|
|
422
|
+
const visibleCharacterRoster = characterRoster.slice(0, 4);
|
|
423
|
+
const currentCharacter = hasCharacterContent(characterDraft)
|
|
424
|
+
? characterDraft
|
|
425
|
+
: characterData;
|
|
426
|
+
const activeRosterEntry = resolveActiveRosterEntry(
|
|
427
|
+
currentCharacter,
|
|
428
|
+
selectedVrmIndex,
|
|
429
|
+
selectedCharacterId,
|
|
430
|
+
characterRoster,
|
|
431
|
+
);
|
|
432
|
+
const detailedEditMode = tab === "character";
|
|
433
|
+
|
|
434
|
+
/* Load voice config on mount */
|
|
435
|
+
useEffect(() => {
|
|
436
|
+
void (async () => {
|
|
437
|
+
setVoiceLoading(true);
|
|
438
|
+
try {
|
|
439
|
+
const cfg = await client.getConfig();
|
|
440
|
+
const messages = cfg.messages as
|
|
441
|
+
| Record<string, Record<string, unknown>>
|
|
442
|
+
| undefined;
|
|
443
|
+
const tts = messages?.tts as VoiceConfig | undefined;
|
|
444
|
+
if (tts) {
|
|
445
|
+
setVoiceConfig(tts);
|
|
446
|
+
if (tts.elevenlabs?.voiceId) {
|
|
447
|
+
const preset = PREMADE_VOICES.find(
|
|
448
|
+
(p) => p.voiceId === tts.elevenlabs?.voiceId,
|
|
449
|
+
);
|
|
450
|
+
setSelectedVoicePresetId(preset?.id ?? null);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
} catch {
|
|
454
|
+
/* ignore */
|
|
455
|
+
}
|
|
456
|
+
setVoiceLoading(false);
|
|
457
|
+
})();
|
|
458
|
+
}, []);
|
|
459
|
+
|
|
460
|
+
const handleSelectPreset = useCallback((preset: VoicePreset) => {
|
|
461
|
+
setSelectedVoicePresetId(preset.id);
|
|
462
|
+
setVoiceConfig((prev) => ({
|
|
463
|
+
...prev,
|
|
464
|
+
elevenlabs: { ...(prev.elevenlabs ?? {}), voiceId: preset.voiceId },
|
|
465
|
+
}));
|
|
466
|
+
}, []);
|
|
467
|
+
|
|
468
|
+
const applyVoicePresetForEntry = useCallback(
|
|
469
|
+
(entry: CharacterRosterEntry) => {
|
|
470
|
+
setVoiceSaveError(null);
|
|
471
|
+
if (!entry.voicePresetId) return;
|
|
472
|
+
const voicePreset = PREMADE_VOICES.find(
|
|
473
|
+
(preset) => preset.id === entry.voicePresetId,
|
|
474
|
+
);
|
|
475
|
+
if (voicePreset) handleSelectPreset(voicePreset);
|
|
476
|
+
},
|
|
477
|
+
[handleSelectPreset],
|
|
478
|
+
);
|
|
479
|
+
|
|
480
|
+
const applyCharacterDefaults = useCallback(
|
|
481
|
+
(entry: CharacterRosterEntry) => {
|
|
482
|
+
const nextCharacter = buildCharacterDraftFromPreset(entry);
|
|
483
|
+
handleFieldEdit("name", nextCharacter.name ?? "");
|
|
484
|
+
handleFieldEdit("username", nextCharacter.username ?? "");
|
|
485
|
+
handleFieldEdit("bio", nextCharacter.bio ?? "");
|
|
486
|
+
handleFieldEdit("system", nextCharacter.system ?? "");
|
|
487
|
+
handleFieldEdit("adjectives", nextCharacter.adjectives ?? []);
|
|
488
|
+
handleFieldEdit(
|
|
489
|
+
"style",
|
|
490
|
+
nextCharacter.style ?? { all: [], chat: [], post: [] },
|
|
491
|
+
);
|
|
492
|
+
handleFieldEdit("messageExamples", nextCharacter.messageExamples ?? []);
|
|
493
|
+
handleFieldEdit("postExamples", nextCharacter.postExamples ?? []);
|
|
494
|
+
},
|
|
495
|
+
[handleFieldEdit],
|
|
496
|
+
);
|
|
497
|
+
|
|
498
|
+
const commitCharacterSelection = useCallback(
|
|
499
|
+
(entry: CharacterRosterEntry, applyDefaults: boolean) => {
|
|
500
|
+
setSelectedCharacterId(entry.id);
|
|
501
|
+
setState("selectedVrmIndex", entry.avatarIndex);
|
|
502
|
+
if (!voiceSelectionLocked && selectedCharacterId !== entry.id) {
|
|
503
|
+
applyVoicePresetForEntry(entry);
|
|
504
|
+
}
|
|
505
|
+
if (applyDefaults) {
|
|
506
|
+
applyCharacterDefaults(entry);
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
[
|
|
510
|
+
applyCharacterDefaults,
|
|
511
|
+
applyVoicePresetForEntry,
|
|
512
|
+
selectedCharacterId,
|
|
513
|
+
setState,
|
|
514
|
+
voiceSelectionLocked,
|
|
515
|
+
],
|
|
516
|
+
);
|
|
517
|
+
|
|
518
|
+
const handleTestVoice = useCallback(
|
|
519
|
+
(previewUrl: string) => {
|
|
520
|
+
if (voiceTestAudio) {
|
|
521
|
+
voiceTestAudio.pause();
|
|
522
|
+
voiceTestAudio.currentTime = 0;
|
|
523
|
+
}
|
|
524
|
+
setVoiceTesting(true);
|
|
525
|
+
const audio = new Audio(previewUrl);
|
|
526
|
+
setVoiceTestAudio(audio);
|
|
527
|
+
audio.onended = () => setVoiceTesting(false);
|
|
528
|
+
audio.onerror = () => setVoiceTesting(false);
|
|
529
|
+
audio.play().catch(() => setVoiceTesting(false));
|
|
530
|
+
},
|
|
531
|
+
[voiceTestAudio],
|
|
532
|
+
);
|
|
533
|
+
|
|
534
|
+
const handleStopTest = useCallback(() => {
|
|
535
|
+
if (voiceTestAudio) {
|
|
536
|
+
voiceTestAudio.pause();
|
|
537
|
+
voiceTestAudio.currentTime = 0;
|
|
538
|
+
}
|
|
539
|
+
setVoiceTesting(false);
|
|
540
|
+
}, [voiceTestAudio]);
|
|
541
|
+
|
|
542
|
+
const persistVoiceConfig = useCallback(async () => {
|
|
543
|
+
setVoiceSaveError(null);
|
|
544
|
+
const normalizedElevenlabs = {
|
|
545
|
+
...voiceConfig.elevenlabs,
|
|
546
|
+
modelId: voiceConfig.elevenlabs?.modelId ?? DEFAULT_ELEVEN_FAST_MODEL,
|
|
547
|
+
};
|
|
548
|
+
const sanitizedKey = sanitizeApiKey(normalizedElevenlabs?.apiKey);
|
|
549
|
+
if (sanitizedKey) normalizedElevenlabs.apiKey = sanitizedKey;
|
|
550
|
+
else delete normalizedElevenlabs.apiKey;
|
|
551
|
+
|
|
552
|
+
const normalizedVoiceConfig: VoiceConfig = {
|
|
553
|
+
...voiceConfig,
|
|
554
|
+
provider: voiceConfig.provider ?? "elevenlabs",
|
|
555
|
+
elevenlabs: normalizedElevenlabs,
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
await client.updateConfig({
|
|
559
|
+
messages: {
|
|
560
|
+
tts: normalizedVoiceConfig,
|
|
561
|
+
},
|
|
562
|
+
});
|
|
563
|
+
dispatchWindowEvent(VOICE_CONFIG_UPDATED_EVENT, normalizedVoiceConfig);
|
|
564
|
+
}, [voiceConfig]);
|
|
565
|
+
|
|
566
|
+
const d = characterDraft;
|
|
567
|
+
const bioText =
|
|
568
|
+
typeof d.bio === "string"
|
|
569
|
+
? d.bio
|
|
570
|
+
: Array.isArray(d.bio)
|
|
571
|
+
? d.bio.join("\n")
|
|
572
|
+
: "";
|
|
573
|
+
|
|
574
|
+
const getCharContext = useCallback(
|
|
575
|
+
() => ({
|
|
576
|
+
name: d.name ?? "",
|
|
577
|
+
system: d.system ?? "",
|
|
578
|
+
bio: bioText,
|
|
579
|
+
style: d.style ?? { all: [], chat: [], post: [] },
|
|
580
|
+
postExamples: d.postExamples ?? [],
|
|
581
|
+
}),
|
|
582
|
+
[d, bioText],
|
|
583
|
+
);
|
|
584
|
+
|
|
585
|
+
useEffect(() => {
|
|
586
|
+
setStyleEntryDrafts({
|
|
587
|
+
all: [...(d.style?.all ?? [])],
|
|
588
|
+
chat: [...(d.style?.chat ?? [])],
|
|
589
|
+
post: [...(d.style?.post ?? [])],
|
|
590
|
+
});
|
|
591
|
+
}, [d.style]);
|
|
592
|
+
|
|
593
|
+
const handleGenerate = useCallback(
|
|
594
|
+
async (field: string, mode: "append" | "replace" = "replace") => {
|
|
595
|
+
setGenerating(field);
|
|
596
|
+
try {
|
|
597
|
+
const { generated } = await client.generateCharacterField(
|
|
598
|
+
field,
|
|
599
|
+
getCharContext(),
|
|
600
|
+
mode,
|
|
601
|
+
);
|
|
602
|
+
if (field === "bio") {
|
|
603
|
+
handleFieldEdit("bio", generated.trim());
|
|
604
|
+
} else if (field === "system") {
|
|
605
|
+
handleFieldEdit("system", generated.trim());
|
|
606
|
+
} else if (field === "style") {
|
|
607
|
+
try {
|
|
608
|
+
const parsed = JSON.parse(generated);
|
|
609
|
+
if (mode === "append") {
|
|
610
|
+
handleStyleEdit(
|
|
611
|
+
"all",
|
|
612
|
+
[...(d.style?.all ?? []), ...(parsed.all ?? [])].join("\n"),
|
|
613
|
+
);
|
|
614
|
+
handleStyleEdit(
|
|
615
|
+
"chat",
|
|
616
|
+
[...(d.style?.chat ?? []), ...(parsed.chat ?? [])].join("\n"),
|
|
617
|
+
);
|
|
618
|
+
handleStyleEdit(
|
|
619
|
+
"post",
|
|
620
|
+
[...(d.style?.post ?? []), ...(parsed.post ?? [])].join("\n"),
|
|
621
|
+
);
|
|
622
|
+
} else {
|
|
623
|
+
if (parsed.all) handleStyleEdit("all", parsed.all.join("\n"));
|
|
624
|
+
if (parsed.chat) handleStyleEdit("chat", parsed.chat.join("\n"));
|
|
625
|
+
if (parsed.post) handleStyleEdit("post", parsed.post.join("\n"));
|
|
626
|
+
}
|
|
627
|
+
} catch {
|
|
628
|
+
/* raw text fallback */
|
|
629
|
+
}
|
|
630
|
+
} else if (field === "chatExamples") {
|
|
631
|
+
try {
|
|
632
|
+
const parsed = JSON.parse(generated);
|
|
633
|
+
if (Array.isArray(parsed)) {
|
|
634
|
+
const formatted = parsed.map(
|
|
635
|
+
(
|
|
636
|
+
convo: Array<{ user: string; content: { text: string } }>,
|
|
637
|
+
) => ({
|
|
638
|
+
examples: convo.map((msg) => ({
|
|
639
|
+
name: msg.user,
|
|
640
|
+
content: { text: msg.content.text },
|
|
641
|
+
})),
|
|
642
|
+
}),
|
|
643
|
+
);
|
|
644
|
+
handleFieldEdit("messageExamples", formatted);
|
|
645
|
+
}
|
|
646
|
+
} catch {
|
|
647
|
+
/* raw text fallback */
|
|
648
|
+
}
|
|
649
|
+
} else if (field === "postExamples") {
|
|
650
|
+
try {
|
|
651
|
+
const parsed = JSON.parse(generated);
|
|
652
|
+
if (Array.isArray(parsed)) {
|
|
653
|
+
if (mode === "append") {
|
|
654
|
+
handleCharacterArrayInput(
|
|
655
|
+
"postExamples",
|
|
656
|
+
[...(d.postExamples ?? []), ...parsed].join("\n"),
|
|
657
|
+
);
|
|
658
|
+
} else {
|
|
659
|
+
handleCharacterArrayInput("postExamples", parsed.join("\n"));
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
} catch {
|
|
663
|
+
/* raw text fallback */
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
} catch {
|
|
667
|
+
/* generation failed */
|
|
668
|
+
}
|
|
669
|
+
setGenerating(null);
|
|
670
|
+
},
|
|
671
|
+
[
|
|
672
|
+
getCharContext,
|
|
673
|
+
d,
|
|
674
|
+
handleFieldEdit,
|
|
675
|
+
handleStyleEdit,
|
|
676
|
+
handleCharacterArrayInput,
|
|
677
|
+
],
|
|
678
|
+
);
|
|
679
|
+
|
|
680
|
+
const handlePendingStyleEntryChange = useCallback(
|
|
681
|
+
(key: StyleSectionKey, value: string) => {
|
|
682
|
+
setPendingStyleEntries((prev) => ({ ...prev, [key]: value }));
|
|
683
|
+
},
|
|
684
|
+
[],
|
|
685
|
+
);
|
|
686
|
+
|
|
687
|
+
const handleAddStyleEntry = useCallback(
|
|
688
|
+
(key: StyleSectionKey) => {
|
|
689
|
+
const value = pendingStyleEntries[key].trim();
|
|
690
|
+
if (!value) return;
|
|
691
|
+
|
|
692
|
+
const nextItems = [...(d.style?.[key] ?? [])];
|
|
693
|
+
if (!nextItems.includes(value)) {
|
|
694
|
+
nextItems.push(value);
|
|
695
|
+
handleStyleEdit(key, nextItems.join("\n"));
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
setPendingStyleEntries((prev) => ({ ...prev, [key]: "" }));
|
|
699
|
+
},
|
|
700
|
+
[d.style, handleStyleEdit, pendingStyleEntries],
|
|
701
|
+
);
|
|
702
|
+
|
|
703
|
+
const handleRemoveStyleEntry = useCallback(
|
|
704
|
+
(key: StyleSectionKey, index: number) => {
|
|
705
|
+
const nextItems = [...(d.style?.[key] ?? [])];
|
|
706
|
+
nextItems.splice(index, 1);
|
|
707
|
+
handleStyleEdit(key, nextItems.join("\n"));
|
|
708
|
+
},
|
|
709
|
+
[d.style, handleStyleEdit],
|
|
710
|
+
);
|
|
711
|
+
|
|
712
|
+
const handleStyleEntryDraftChange = useCallback(
|
|
713
|
+
(key: StyleSectionKey, index: number, value: string) => {
|
|
714
|
+
setStyleEntryDrafts((prev) => {
|
|
715
|
+
const nextItems = [...(prev[key] ?? [])];
|
|
716
|
+
nextItems[index] = value;
|
|
717
|
+
return { ...prev, [key]: nextItems };
|
|
718
|
+
});
|
|
719
|
+
},
|
|
720
|
+
[],
|
|
721
|
+
);
|
|
722
|
+
|
|
723
|
+
const handleCommitStyleEntry = useCallback(
|
|
724
|
+
(key: StyleSectionKey, index: number) => {
|
|
725
|
+
const nextValue = styleEntryDrafts[key]?.[index]?.trim() ?? "";
|
|
726
|
+
const nextItems = [...(d.style?.[key] ?? [])];
|
|
727
|
+
|
|
728
|
+
if (!nextValue) {
|
|
729
|
+
nextItems.splice(index, 1);
|
|
730
|
+
} else {
|
|
731
|
+
nextItems[index] = nextValue;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
handleStyleEdit(key, nextItems.join("\n"));
|
|
735
|
+
},
|
|
736
|
+
[d.style, handleStyleEdit, styleEntryDrafts],
|
|
737
|
+
);
|
|
738
|
+
|
|
739
|
+
const handleSelectCharacter = useCallback(
|
|
740
|
+
(entry: CharacterRosterEntry) => {
|
|
741
|
+
const shouldApplyDefaults =
|
|
742
|
+
!customOverridesEnabled &&
|
|
743
|
+
(!currentCharacter ||
|
|
744
|
+
!activeRosterEntry ||
|
|
745
|
+
characterDraftMatchesPreset(
|
|
746
|
+
currentCharacter,
|
|
747
|
+
selectedVrmIndex,
|
|
748
|
+
activeRosterEntry,
|
|
749
|
+
));
|
|
750
|
+
commitCharacterSelection(entry, shouldApplyDefaults);
|
|
751
|
+
},
|
|
752
|
+
[
|
|
753
|
+
activeRosterEntry,
|
|
754
|
+
commitCharacterSelection,
|
|
755
|
+
currentCharacter,
|
|
756
|
+
customOverridesEnabled,
|
|
757
|
+
selectedVrmIndex,
|
|
758
|
+
],
|
|
759
|
+
);
|
|
760
|
+
|
|
761
|
+
const handleCustomOverridesChange = useCallback(
|
|
762
|
+
(enabled: boolean) => {
|
|
763
|
+
setTab(enabled ? "character" : "character-select");
|
|
764
|
+
setCustomOverridesEnabled(enabled);
|
|
765
|
+
setCustomizeStep("core");
|
|
766
|
+
if (enabled) return;
|
|
767
|
+
|
|
768
|
+
const activeEntry = resolveActiveRosterEntry(
|
|
769
|
+
currentCharacter,
|
|
770
|
+
selectedVrmIndex,
|
|
771
|
+
selectedCharacterId,
|
|
772
|
+
characterRoster,
|
|
773
|
+
);
|
|
774
|
+
if (activeEntry) {
|
|
775
|
+
setSelectedCharacterId(activeEntry.id);
|
|
776
|
+
}
|
|
777
|
+
},
|
|
778
|
+
[
|
|
779
|
+
characterRoster,
|
|
780
|
+
currentCharacter,
|
|
781
|
+
selectedCharacterId,
|
|
782
|
+
selectedVrmIndex,
|
|
783
|
+
setTab,
|
|
784
|
+
],
|
|
785
|
+
);
|
|
786
|
+
|
|
787
|
+
useEffect(() => {
|
|
788
|
+
setCustomOverridesEnabled(detailedEditMode);
|
|
789
|
+
if (detailedEditMode) {
|
|
790
|
+
setCustomizeStep("core");
|
|
791
|
+
}
|
|
792
|
+
}, [detailedEditMode]);
|
|
793
|
+
|
|
794
|
+
useEffect(() => {
|
|
795
|
+
if (
|
|
796
|
+
characterLoading ||
|
|
797
|
+
selectedCharacterId ||
|
|
798
|
+
!characterRoster.length ||
|
|
799
|
+
!currentCharacter
|
|
800
|
+
) {
|
|
801
|
+
return;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
const activeEntry =
|
|
805
|
+
resolveActiveRosterEntry(
|
|
806
|
+
currentCharacter,
|
|
807
|
+
selectedVrmIndex,
|
|
808
|
+
selectedCharacterId,
|
|
809
|
+
characterRoster,
|
|
810
|
+
) ??
|
|
811
|
+
characterRoster[0] ??
|
|
812
|
+
null;
|
|
813
|
+
if (!activeEntry) return;
|
|
814
|
+
const matchesFactory = characterDraftMatchesPreset(
|
|
815
|
+
currentCharacter,
|
|
816
|
+
selectedVrmIndex,
|
|
817
|
+
activeEntry,
|
|
818
|
+
);
|
|
819
|
+
setSelectedCharacterId(activeEntry.id);
|
|
820
|
+
setCustomOverridesEnabled(detailedEditMode);
|
|
821
|
+
if (matchesFactory) {
|
|
822
|
+
commitCharacterSelection(activeEntry, true);
|
|
823
|
+
}
|
|
824
|
+
}, [
|
|
825
|
+
characterLoading,
|
|
826
|
+
characterRoster,
|
|
827
|
+
commitCharacterSelection,
|
|
828
|
+
currentCharacter,
|
|
829
|
+
detailedEditMode,
|
|
830
|
+
selectedCharacterId,
|
|
831
|
+
selectedVrmIndex,
|
|
832
|
+
]);
|
|
833
|
+
|
|
834
|
+
const handleSaveAll = useCallback(async () => {
|
|
835
|
+
setVoiceSaving(true);
|
|
836
|
+
setVoiceSaveError(null);
|
|
837
|
+
try {
|
|
838
|
+
await persistVoiceConfig();
|
|
839
|
+
} catch (err) {
|
|
840
|
+
setVoiceSaveError(
|
|
841
|
+
err instanceof Error ? err.message : "Failed to save voice settings.",
|
|
842
|
+
);
|
|
843
|
+
setVoiceSaving(false);
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
setVoiceSaving(false);
|
|
847
|
+
await handleSaveCharacter();
|
|
848
|
+
}, [handleSaveCharacter, persistVoiceConfig]);
|
|
849
|
+
|
|
850
|
+
/* ── Helpers ────────────────────────────────────────────────────── */
|
|
851
|
+
const cardCls = sceneOverlay
|
|
852
|
+
? "p-5 border border-white/10 bg-black/15 backdrop-blur-md rounded-2xl shadow-[0_18px_48px_rgba(0,0,0,0.28)]"
|
|
853
|
+
: "p-5 border border-border/40 bg-card/40 backdrop-blur-xl rounded-2xl shadow-sm";
|
|
854
|
+
const editorCardCls = `${cardCls} flex min-h-0 flex-col overflow-hidden`;
|
|
855
|
+
const sectionCls =
|
|
856
|
+
sceneOverlay && !inModal ? "relative z-10 mt-4 px-1" : `mt-4 ${cardCls}`;
|
|
857
|
+
const labelCls = "font-medium text-xs text-muted mb-1 block";
|
|
858
|
+
const hintCls = "text-[11px] text-muted";
|
|
859
|
+
const scrollPaneCls =
|
|
860
|
+
"min-h-0 overflow-y-auto pr-1 [scrollbar-gutter:stable] custom-scrollbar";
|
|
861
|
+
|
|
862
|
+
if (characterLoading && !characterData) {
|
|
863
|
+
return (
|
|
864
|
+
<div className={sectionCls}>
|
|
865
|
+
<div className="text-center py-6 text-[var(--muted)] text-[13px]">
|
|
866
|
+
{t("characterview.loadingCharacterDa")}
|
|
867
|
+
</div>
|
|
868
|
+
</div>
|
|
869
|
+
);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
const hasWallet = Boolean(walletConfig?.evmAddress);
|
|
873
|
+
const isRegistered = registryStatus?.registered === true;
|
|
874
|
+
const dropLive =
|
|
875
|
+
dropStatus?.dropEnabled &&
|
|
876
|
+
dropStatus?.publicMintOpen &&
|
|
877
|
+
!dropStatus?.mintedOut;
|
|
878
|
+
const userMinted = dropStatus?.userHasMinted === true;
|
|
879
|
+
const activeVoicePreset =
|
|
880
|
+
PREMADE_VOICES.find((preset) => preset.id === selectedVoicePresetId) ??
|
|
881
|
+
null;
|
|
882
|
+
const voiceSelectValue = selectedVoicePresetId ?? null;
|
|
883
|
+
const combinedSaveError = voiceSaveError ?? characterSaveError;
|
|
884
|
+
const customizationActionLabel = customOverridesEnabled
|
|
885
|
+
? t("characterview.backToCharacterSelect")
|
|
886
|
+
: t("characterview.customize");
|
|
887
|
+
const characterRosterGridCls =
|
|
888
|
+
"flex flex-wrap items-start justify-center gap-y-1";
|
|
889
|
+
const rosterSlantClipPath =
|
|
890
|
+
"polygon(32px 0, 100% 0, calc(100% - 32px) 100%, 0 100%)";
|
|
891
|
+
const insetShadowClipPath =
|
|
892
|
+
"polygon(0px 0, 100% 0, calc(100% - 4px) 100%, -8px 100%)";
|
|
893
|
+
const rootCls =
|
|
894
|
+
sceneOverlay && !inModal
|
|
895
|
+
? "relative z-10 flex min-h-full flex-col justify-end pb-4"
|
|
896
|
+
: `${inModal || sceneOverlay ? "pb-8" : ""} ${
|
|
897
|
+
sceneOverlay ? "relative z-10" : ""
|
|
898
|
+
}`;
|
|
899
|
+
const coreFieldsPanel = (
|
|
900
|
+
<div
|
|
901
|
+
className={`${editorCardCls} min-h-[24rem]`}
|
|
902
|
+
data-testid="character-core-editor"
|
|
903
|
+
>
|
|
904
|
+
<div className="flex min-h-0 flex-col gap-2">
|
|
905
|
+
<div className="flex items-center justify-between">
|
|
906
|
+
<span className={labelCls}>{t("characterview.aboutMe")}</span>
|
|
907
|
+
<Button
|
|
908
|
+
variant="ghost"
|
|
909
|
+
size="sm"
|
|
910
|
+
className="h-6 rounded-md px-2 text-[10px] font-bold text-accent"
|
|
911
|
+
onClick={() => void handleGenerate("bio")}
|
|
912
|
+
disabled={generating === "bio"}
|
|
913
|
+
>
|
|
914
|
+
{generating === "bio" ? "generating..." : "regenerate"}
|
|
915
|
+
</Button>
|
|
916
|
+
</div>
|
|
917
|
+
<Textarea
|
|
918
|
+
value={bioText}
|
|
919
|
+
rows={6}
|
|
920
|
+
placeholder={t("characterview.describeWhoYourAg")}
|
|
921
|
+
onChange={(e) => handleFieldEdit("bio", e.target.value)}
|
|
922
|
+
className="min-h-[10rem] flex-1 resize-none overflow-y-auto rounded-lg border-border/50 bg-bg p-3 text-sm leading-relaxed focus-visible:border-accent focus-visible:ring-accent/50"
|
|
923
|
+
/>
|
|
924
|
+
</div>
|
|
925
|
+
|
|
926
|
+
<div className="flex min-h-0 flex-col gap-2">
|
|
927
|
+
<div className="flex items-center justify-between">
|
|
928
|
+
<span className={labelCls}>
|
|
929
|
+
{t("characterview.directionsAndThing")}
|
|
930
|
+
</span>
|
|
931
|
+
<Button
|
|
932
|
+
variant="ghost"
|
|
933
|
+
size="sm"
|
|
934
|
+
className="h-6 rounded-md px-2 text-[10px] font-bold text-accent"
|
|
935
|
+
onClick={() => void handleGenerate("system")}
|
|
936
|
+
disabled={generating === "system"}
|
|
937
|
+
>
|
|
938
|
+
{generating === "system" ? "generating..." : "regenerate"}
|
|
939
|
+
</Button>
|
|
940
|
+
</div>
|
|
941
|
+
<Textarea
|
|
942
|
+
value={d.system ?? ""}
|
|
943
|
+
rows={7}
|
|
944
|
+
maxLength={10000}
|
|
945
|
+
placeholder={t("characterview.writeInFirstPerso")}
|
|
946
|
+
onChange={(e) => handleFieldEdit("system", e.target.value)}
|
|
947
|
+
className="min-h-[10rem] flex-1 resize-none overflow-y-auto rounded-lg border-border/50 bg-bg p-3 font-mono text-xs leading-relaxed focus-visible:border-accent focus-visible:ring-accent/50"
|
|
948
|
+
/>
|
|
949
|
+
</div>
|
|
950
|
+
</div>
|
|
951
|
+
);
|
|
952
|
+
const styleEditorPanel = (
|
|
953
|
+
<div
|
|
954
|
+
className={`${editorCardCls} min-h-[24rem]`}
|
|
955
|
+
data-testid="character-customize-sidebar"
|
|
956
|
+
>
|
|
957
|
+
<div
|
|
958
|
+
className="flex min-h-0 flex-col gap-3"
|
|
959
|
+
data-testid="character-style-editor"
|
|
960
|
+
>
|
|
961
|
+
<div className="flex items-center justify-between gap-3">
|
|
962
|
+
<div className="text-sm font-bold tracking-wide text-txt">
|
|
963
|
+
{t("characterview.StyleRules")}
|
|
964
|
+
</div>
|
|
965
|
+
<Button
|
|
966
|
+
variant="outline"
|
|
967
|
+
size="sm"
|
|
968
|
+
className="h-7 shrink-0 rounded-md px-2.5 text-[11px] font-bold"
|
|
969
|
+
onClick={() => void handleGenerate("style", "replace")}
|
|
970
|
+
disabled={generating === "style"}
|
|
971
|
+
>
|
|
972
|
+
{generating === "style" ? "generating..." : "regenerate"}
|
|
973
|
+
</Button>
|
|
974
|
+
</div>
|
|
975
|
+
|
|
976
|
+
<div
|
|
977
|
+
className="grid min-h-0 flex-1 gap-3 xl:grid-cols-1 2xl:grid-cols-3"
|
|
978
|
+
data-testid="character-style-editor-scroll"
|
|
979
|
+
>
|
|
980
|
+
{STYLE_SECTION_KEYS.map((key) => {
|
|
981
|
+
const items = d.style?.[key] ?? [];
|
|
982
|
+
return (
|
|
983
|
+
<div
|
|
984
|
+
key={key}
|
|
985
|
+
className="flex min-h-0 flex-col overflow-hidden rounded-lg border border-border/30 bg-bg/30"
|
|
986
|
+
data-testid={`style-section-${key}`}
|
|
987
|
+
>
|
|
988
|
+
<div className="flex items-center justify-between gap-2 border-b border-border/20 px-3 py-2">
|
|
989
|
+
<div className="flex items-center gap-2">
|
|
990
|
+
<span className="text-[11px] font-bold uppercase tracking-widest text-muted">
|
|
991
|
+
{key}
|
|
992
|
+
</span>
|
|
993
|
+
<span className="text-[10px] font-bold uppercase tracking-[0.18em] text-muted/70">
|
|
994
|
+
{items.length} rule{items.length === 1 ? "" : "s"}
|
|
995
|
+
</span>
|
|
996
|
+
</div>
|
|
997
|
+
</div>
|
|
998
|
+
|
|
999
|
+
<div className={`${scrollPaneCls} flex-1 p-3 pr-2`}>
|
|
1000
|
+
<div className="flex flex-col gap-2">
|
|
1001
|
+
{items.length > 0 ? (
|
|
1002
|
+
items.map((item, index) => (
|
|
1003
|
+
<div
|
|
1004
|
+
key={getStyleEntryRenderKey(key, items, item, index)}
|
|
1005
|
+
className="flex items-start gap-2 rounded-md border border-border/20 bg-bg/50 p-2"
|
|
1006
|
+
data-testid={`style-entry-${key}-${index}`}
|
|
1007
|
+
>
|
|
1008
|
+
<span className="mt-0.5 shrink-0 text-[10px] font-bold text-muted/70">
|
|
1009
|
+
{index + 1}
|
|
1010
|
+
</span>
|
|
1011
|
+
<Textarea
|
|
1012
|
+
value={styleEntryDrafts[key]?.[index] ?? item}
|
|
1013
|
+
rows={2}
|
|
1014
|
+
onChange={(e) =>
|
|
1015
|
+
handleStyleEntryDraftChange(
|
|
1016
|
+
key,
|
|
1017
|
+
index,
|
|
1018
|
+
e.target.value,
|
|
1019
|
+
)
|
|
1020
|
+
}
|
|
1021
|
+
onBlur={() => handleCommitStyleEntry(key, index)}
|
|
1022
|
+
className="min-h-[72px] min-w-0 flex-1 resize-none rounded-md border-border/40 bg-bg p-2 text-xs leading-relaxed text-txt focus-visible:border-accent/50 focus-visible:ring-accent/50"
|
|
1023
|
+
data-testid={`style-entry-editor-${key}-${index}`}
|
|
1024
|
+
/>
|
|
1025
|
+
<Button
|
|
1026
|
+
variant="ghost"
|
|
1027
|
+
size="icon"
|
|
1028
|
+
className="h-7 w-7 shrink-0 text-muted hover:bg-danger/10 hover:text-danger"
|
|
1029
|
+
onClick={() => handleRemoveStyleEntry(key, index)}
|
|
1030
|
+
title={t("characterview.remove")}
|
|
1031
|
+
>
|
|
1032
|
+
×
|
|
1033
|
+
</Button>
|
|
1034
|
+
</div>
|
|
1035
|
+
))
|
|
1036
|
+
) : (
|
|
1037
|
+
<div
|
|
1038
|
+
className={`${hintCls} rounded-md border border-dashed border-border/30 bg-bg/40 px-3 py-2`}
|
|
1039
|
+
>
|
|
1040
|
+
{STYLE_SECTION_EMPTY_STATES[key]}
|
|
1041
|
+
</div>
|
|
1042
|
+
)}
|
|
1043
|
+
</div>
|
|
1044
|
+
</div>
|
|
1045
|
+
|
|
1046
|
+
<div className="border-t border-border/20 p-3">
|
|
1047
|
+
<div className="flex items-center gap-2">
|
|
1048
|
+
<Input
|
|
1049
|
+
type="text"
|
|
1050
|
+
value={pendingStyleEntries[key]}
|
|
1051
|
+
placeholder={STYLE_SECTION_PLACEHOLDERS[key]}
|
|
1052
|
+
onChange={(e) =>
|
|
1053
|
+
handlePendingStyleEntryChange(key, e.target.value)
|
|
1054
|
+
}
|
|
1055
|
+
onKeyDown={(e) => {
|
|
1056
|
+
if (e.key === "Enter") {
|
|
1057
|
+
e.preventDefault();
|
|
1058
|
+
handleAddStyleEntry(key);
|
|
1059
|
+
}
|
|
1060
|
+
}}
|
|
1061
|
+
className="h-8 min-w-0 flex-1 rounded-md border-border/40 bg-bg focus-visible:border-accent focus-visible:ring-accent/50"
|
|
1062
|
+
data-testid={`style-entry-input-${key}`}
|
|
1063
|
+
/>
|
|
1064
|
+
<Button
|
|
1065
|
+
variant="outline"
|
|
1066
|
+
size="sm"
|
|
1067
|
+
className="h-8 shrink-0 rounded-md px-3 text-[11px] font-bold"
|
|
1068
|
+
onClick={() => handleAddStyleEntry(key)}
|
|
1069
|
+
disabled={!pendingStyleEntries[key].trim()}
|
|
1070
|
+
>
|
|
1071
|
+
+ add
|
|
1072
|
+
</Button>
|
|
1073
|
+
</div>
|
|
1074
|
+
</div>
|
|
1075
|
+
</div>
|
|
1076
|
+
);
|
|
1077
|
+
})}
|
|
1078
|
+
</div>
|
|
1079
|
+
</div>
|
|
1080
|
+
</div>
|
|
1081
|
+
);
|
|
1082
|
+
const chatExamplesPanel = (
|
|
1083
|
+
<div
|
|
1084
|
+
className={`${editorCardCls} min-h-[24rem]`}
|
|
1085
|
+
data-testid="character-chat-examples-card"
|
|
1086
|
+
>
|
|
1087
|
+
<div className="mb-4 flex items-center justify-between gap-3 border-b border-border/40 pb-3">
|
|
1088
|
+
<div className="flex flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3">
|
|
1089
|
+
<div className="text-sm font-bold tracking-wide text-txt">
|
|
1090
|
+
{t("characterview.chatExamples")}
|
|
1091
|
+
</div>
|
|
1092
|
+
<span className="rounded-full border border-white/5 bg-black/10 px-2 py-0.5 text-[11px] font-medium text-muted">
|
|
1093
|
+
{t("characterview.HowTheAgentResp")}
|
|
1094
|
+
</span>
|
|
1095
|
+
</div>
|
|
1096
|
+
<Button
|
|
1097
|
+
variant="outline"
|
|
1098
|
+
size="sm"
|
|
1099
|
+
className="h-7 shrink-0 border-border/50 bg-bg/50 text-[11px] font-bold text-accent shadow-inner transition-all hover:border-accent/40 hover:text-accent"
|
|
1100
|
+
onClick={() => void handleGenerate("chatExamples", "replace")}
|
|
1101
|
+
disabled={generating === "chatExamples"}
|
|
1102
|
+
>
|
|
1103
|
+
{generating === "chatExamples" ? "generating..." : "generate"}
|
|
1104
|
+
</Button>
|
|
1105
|
+
</div>
|
|
1106
|
+
|
|
1107
|
+
<div className={`${scrollPaneCls} flex flex-1 flex-col gap-3 pr-2`}>
|
|
1108
|
+
{(d.messageExamples ?? []).map((convo, ci) => (
|
|
1109
|
+
<div
|
|
1110
|
+
key={convo.examples
|
|
1111
|
+
.map((msg) => `${msg.name}:${msg.content?.text ?? ""}`)
|
|
1112
|
+
.join("|")}
|
|
1113
|
+
className="rounded-xl border border-border/40 bg-black/10 p-4 shadow-inner backdrop-blur-sm"
|
|
1114
|
+
>
|
|
1115
|
+
<div className="mb-3 flex items-center justify-between border-b border-border/30 pb-2">
|
|
1116
|
+
<span className="text-[11px] font-bold uppercase tracking-widest text-muted">
|
|
1117
|
+
{t("characterview.conversation")} {ci + 1}
|
|
1118
|
+
</span>
|
|
1119
|
+
<Button
|
|
1120
|
+
variant="ghost"
|
|
1121
|
+
size="sm"
|
|
1122
|
+
className="h-6 px-2 text-[10px] font-bold text-muted transition-all hover:bg-danger/10 hover:text-danger"
|
|
1123
|
+
onClick={() => {
|
|
1124
|
+
const updated = [...(d.messageExamples ?? [])];
|
|
1125
|
+
updated.splice(ci, 1);
|
|
1126
|
+
handleFieldEdit("messageExamples", updated);
|
|
1127
|
+
}}
|
|
1128
|
+
>
|
|
1129
|
+
{t("characterview.remove")}
|
|
1130
|
+
</Button>
|
|
1131
|
+
</div>
|
|
1132
|
+
<div className="flex flex-col gap-2">
|
|
1133
|
+
{convo.examples.map((msg, mi) => (
|
|
1134
|
+
<div
|
|
1135
|
+
key={`${msg.name}:${msg.content?.text ?? ""}`}
|
|
1136
|
+
className="flex items-center gap-3"
|
|
1137
|
+
>
|
|
1138
|
+
<span
|
|
1139
|
+
className={`w-12 shrink-0 text-right text-[11px] font-bold uppercase tracking-wider ${msg.name === "{{user1}}" ? "text-muted" : "text-accent"}`}
|
|
1140
|
+
>
|
|
1141
|
+
{msg.name === "{{user1}}" ? "user" : "agent"}
|
|
1142
|
+
</span>
|
|
1143
|
+
<Input
|
|
1144
|
+
type="text"
|
|
1145
|
+
value={msg.content?.text ?? ""}
|
|
1146
|
+
onChange={(e) => {
|
|
1147
|
+
const updated = [...(d.messageExamples ?? [])];
|
|
1148
|
+
const convoClone = {
|
|
1149
|
+
examples: [...updated[ci].examples],
|
|
1150
|
+
};
|
|
1151
|
+
convoClone.examples[mi] = {
|
|
1152
|
+
...convoClone.examples[mi],
|
|
1153
|
+
content: { text: e.target.value },
|
|
1154
|
+
};
|
|
1155
|
+
updated[ci] = convoClone;
|
|
1156
|
+
handleFieldEdit("messageExamples", updated);
|
|
1157
|
+
}}
|
|
1158
|
+
className="h-9 flex-1 rounded-lg border-border/50 bg-bg/50 text-xs shadow-inner backdrop-blur-md transition-all focus-visible:border-accent/50 focus-visible:ring-accent/50"
|
|
1159
|
+
/>
|
|
1160
|
+
</div>
|
|
1161
|
+
))}
|
|
1162
|
+
</div>
|
|
1163
|
+
</div>
|
|
1164
|
+
))}
|
|
1165
|
+
{(d.messageExamples ?? []).length === 0 && (
|
|
1166
|
+
<div
|
|
1167
|
+
className={`${hintCls} rounded-xl border border-white/5 bg-black/5 py-3 text-center`}
|
|
1168
|
+
>
|
|
1169
|
+
{t("characterview.noChatExamplesYet")}
|
|
1170
|
+
</div>
|
|
1171
|
+
)}
|
|
1172
|
+
</div>
|
|
1173
|
+
</div>
|
|
1174
|
+
);
|
|
1175
|
+
const postExamplesPanel = (
|
|
1176
|
+
<div
|
|
1177
|
+
className={`${editorCardCls} min-h-[24rem]`}
|
|
1178
|
+
data-testid="character-post-examples-card"
|
|
1179
|
+
>
|
|
1180
|
+
<div className="mb-4 flex items-center justify-between gap-3 border-b border-border/40 pb-3">
|
|
1181
|
+
<div className="flex flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3">
|
|
1182
|
+
<div className="text-sm font-bold tracking-wide text-txt">
|
|
1183
|
+
{t("characterview.postExamples")}
|
|
1184
|
+
</div>
|
|
1185
|
+
<span className="rounded-full border border-white/5 bg-black/10 px-2 py-0.5 text-[11px] font-medium text-muted">
|
|
1186
|
+
{t("characterview.SocialMediaVoice")}
|
|
1187
|
+
</span>
|
|
1188
|
+
</div>
|
|
1189
|
+
<Button
|
|
1190
|
+
variant="outline"
|
|
1191
|
+
size="sm"
|
|
1192
|
+
className="h-7 shrink-0 border-border/50 bg-bg/50 text-[11px] font-bold text-accent shadow-inner transition-all hover:border-accent/40 hover:text-accent"
|
|
1193
|
+
onClick={() => void handleGenerate("postExamples", "replace")}
|
|
1194
|
+
disabled={generating === "postExamples"}
|
|
1195
|
+
>
|
|
1196
|
+
{generating === "postExamples" ? "generating..." : "generate"}
|
|
1197
|
+
</Button>
|
|
1198
|
+
</div>
|
|
1199
|
+
|
|
1200
|
+
<div className={`${scrollPaneCls} flex flex-1 flex-col gap-2 pr-2`}>
|
|
1201
|
+
{(d.postExamples ?? []).map((post: string, pi: number) => (
|
|
1202
|
+
<div key={post || `post-${pi}`} className="flex items-center gap-2">
|
|
1203
|
+
<Input
|
|
1204
|
+
type="text"
|
|
1205
|
+
value={post}
|
|
1206
|
+
onChange={(e) => {
|
|
1207
|
+
const updated = [...(d.postExamples ?? [])];
|
|
1208
|
+
updated[pi] = e.target.value;
|
|
1209
|
+
handleFieldEdit("postExamples", updated);
|
|
1210
|
+
}}
|
|
1211
|
+
className="h-9 flex-1 rounded-lg border-border/50 bg-bg/50 text-xs shadow-inner backdrop-blur-md transition-all focus-visible:border-accent/50 focus-visible:ring-accent/50"
|
|
1212
|
+
/>
|
|
1213
|
+
<Button
|
|
1214
|
+
variant="ghost"
|
|
1215
|
+
size="icon"
|
|
1216
|
+
className="h-8 w-8 text-muted hover:bg-danger/10 hover:text-danger"
|
|
1217
|
+
onClick={() => {
|
|
1218
|
+
const updated = [...(d.postExamples ?? [])];
|
|
1219
|
+
updated.splice(pi, 1);
|
|
1220
|
+
handleFieldEdit("postExamples", updated);
|
|
1221
|
+
}}
|
|
1222
|
+
>
|
|
1223
|
+
×
|
|
1224
|
+
</Button>
|
|
1225
|
+
</div>
|
|
1226
|
+
))}
|
|
1227
|
+
{(d.postExamples ?? []).length === 0 && (
|
|
1228
|
+
<div
|
|
1229
|
+
className={`${hintCls} rounded-xl border border-white/5 bg-black/5 py-3 text-center`}
|
|
1230
|
+
>
|
|
1231
|
+
{t("characterview.noPostExamplesYet")}
|
|
1232
|
+
</div>
|
|
1233
|
+
)}
|
|
1234
|
+
</div>
|
|
1235
|
+
|
|
1236
|
+
<div className="border-t border-border/40 pt-4">
|
|
1237
|
+
<Button
|
|
1238
|
+
variant="ghost"
|
|
1239
|
+
size="sm"
|
|
1240
|
+
className="self-start rounded-md border border-transparent text-[11px] font-bold text-accent transition-all hover:border-accent/30 hover:bg-accent/10"
|
|
1241
|
+
onClick={() => {
|
|
1242
|
+
const updated = [...(d.postExamples ?? []), ""];
|
|
1243
|
+
handleFieldEdit("postExamples", updated);
|
|
1244
|
+
}}
|
|
1245
|
+
>
|
|
1246
|
+
{t("characterview.AddPost")}
|
|
1247
|
+
</Button>
|
|
1248
|
+
</div>
|
|
1249
|
+
</div>
|
|
1250
|
+
);
|
|
1251
|
+
|
|
1252
|
+
return (
|
|
1253
|
+
<div className={rootCls}>
|
|
1254
|
+
{/* ═══ ON-CHAIN IDENTITY ═══ */}
|
|
1255
|
+
{hasWallet && (
|
|
1256
|
+
<div className={sectionCls}>
|
|
1257
|
+
{!isRegistered && !dropLive && (
|
|
1258
|
+
<div className="flex flex-col gap-3">
|
|
1259
|
+
<div className="text-[12px] text-[var(--muted)]">
|
|
1260
|
+
{t("characterview.RegisterYourAgent")}
|
|
1261
|
+
</div>
|
|
1262
|
+
<div className="flex items-center gap-2">
|
|
1263
|
+
<button
|
|
1264
|
+
type="button"
|
|
1265
|
+
className="btn text-xs py-[5px] px-4 !mt-0 cursor-pointer"
|
|
1266
|
+
disabled={registryRegistering || registryLoading}
|
|
1267
|
+
onClick={() => void registerOnChain()}
|
|
1268
|
+
>
|
|
1269
|
+
{registryRegistering ? "registering..." : "register now"}
|
|
1270
|
+
</button>
|
|
1271
|
+
{registryError && (
|
|
1272
|
+
<span className="text-xs text-[var(--danger,#e74c3c)]">
|
|
1273
|
+
{registryError}
|
|
1274
|
+
</span>
|
|
1275
|
+
)}
|
|
1276
|
+
</div>
|
|
1277
|
+
</div>
|
|
1278
|
+
)}
|
|
1279
|
+
</div>
|
|
1280
|
+
)}
|
|
1281
|
+
|
|
1282
|
+
{isRegistered &&
|
|
1283
|
+
(() => {
|
|
1284
|
+
const currentName = characterDraft?.name || d.name || "";
|
|
1285
|
+
const onChainName = registryStatus.agentName || "";
|
|
1286
|
+
const nameOutOfSync =
|
|
1287
|
+
currentName && onChainName && currentName !== onChainName;
|
|
1288
|
+
return (
|
|
1289
|
+
<div className={sectionCls}>
|
|
1290
|
+
<div className="flex flex-col gap-2">
|
|
1291
|
+
<div className="flex items-center gap-2 text-[12px]">
|
|
1292
|
+
<span className="text-green-400 font-bold tracking-wide">
|
|
1293
|
+
{t("characterview.Registered")}
|
|
1294
|
+
</span>
|
|
1295
|
+
<span className="text-muted/50">|</span>
|
|
1296
|
+
<span className="text-muted font-medium">
|
|
1297
|
+
{t("characterview.Token")}
|
|
1298
|
+
{registryStatus.tokenId}
|
|
1299
|
+
</span>
|
|
1300
|
+
<span className="text-muted/50">|</span>
|
|
1301
|
+
<span className="text-txt font-semibold">{onChainName}</span>
|
|
1302
|
+
</div>
|
|
1303
|
+
{nameOutOfSync && (
|
|
1304
|
+
<div className="flex items-center gap-3 bg-amber-400/10 border border-amber-400/20 px-3 py-2 rounded-lg">
|
|
1305
|
+
<span className="text-[11px] text-amber-400/80 font-medium tracking-wide">
|
|
1306
|
+
{t("characterview.OnChainName")}{" "}
|
|
1307
|
+
<strong className="text-amber-400">{onChainName}</strong>{" "}
|
|
1308
|
+
{t("characterview.DiffersFrom")}{" "}
|
|
1309
|
+
<strong className="text-amber-400">{currentName}"</strong>
|
|
1310
|
+
</span>
|
|
1311
|
+
<Button
|
|
1312
|
+
variant="outline"
|
|
1313
|
+
size="sm"
|
|
1314
|
+
className="text-[10px] h-6 px-2.5 border-amber-400/50 text-amber-400 hover:bg-amber-400/20 transition-all font-bold"
|
|
1315
|
+
disabled={registryRegistering}
|
|
1316
|
+
onClick={() => void syncRegistryProfile()}
|
|
1317
|
+
>
|
|
1318
|
+
{registryRegistering ? "syncing..." : "sync to chain"}
|
|
1319
|
+
</Button>
|
|
1320
|
+
</div>
|
|
1321
|
+
)}
|
|
1322
|
+
{registryError && (
|
|
1323
|
+
<span className="text-xs text-[var(--danger,#e74c3c)]">
|
|
1324
|
+
{registryError}
|
|
1325
|
+
</span>
|
|
1326
|
+
)}
|
|
1327
|
+
<a
|
|
1328
|
+
href={`https://etherscan.io/token/${registryStatus.walletAddress}`}
|
|
1329
|
+
target="_blank"
|
|
1330
|
+
rel="noopener noreferrer"
|
|
1331
|
+
className="text-[11px] underline text-[var(--accent)]"
|
|
1332
|
+
>
|
|
1333
|
+
{t("characterview.viewOnEtherscan")}
|
|
1334
|
+
</a>
|
|
1335
|
+
</div>
|
|
1336
|
+
</div>
|
|
1337
|
+
);
|
|
1338
|
+
})()}
|
|
1339
|
+
|
|
1340
|
+
{hasWallet && userMinted && !isRegistered && (
|
|
1341
|
+
<div className={sectionCls}>
|
|
1342
|
+
<div className="text-[12px] text-[var(--ok,#16a34a)]">
|
|
1343
|
+
{t("characterview.MintedFromCollecti")}
|
|
1344
|
+
</div>
|
|
1345
|
+
</div>
|
|
1346
|
+
)}
|
|
1347
|
+
|
|
1348
|
+
{!customOverridesEnabled ? (
|
|
1349
|
+
<div className={sectionCls}>
|
|
1350
|
+
<div className="overflow-hidden" data-testid="character-roster-grid">
|
|
1351
|
+
<div className={characterRosterGridCls}>
|
|
1352
|
+
{visibleCharacterRoster.length > 0 ? (
|
|
1353
|
+
visibleCharacterRoster.map((entry: CharacterRosterEntry) => {
|
|
1354
|
+
const isSelected = selectedCharacterId === entry.id;
|
|
1355
|
+
|
|
1356
|
+
return (
|
|
1357
|
+
<button
|
|
1358
|
+
key={entry.id}
|
|
1359
|
+
type="button"
|
|
1360
|
+
className={`group relative -mx-3 min-w-0 w-[9.75rem] text-center transition-all duration-300 ease-out ${
|
|
1361
|
+
isSelected
|
|
1362
|
+
? "z-100 scale-[1.00] opacity-100"
|
|
1363
|
+
: "scale-[1.00] opacity-70 hover:scale-[1.00] hover:opacity-100"
|
|
1364
|
+
}`}
|
|
1365
|
+
onClick={() => handleSelectCharacter(entry)}
|
|
1366
|
+
data-testid={`character-preset-${entry.id}`}
|
|
1367
|
+
>
|
|
1368
|
+
<div
|
|
1369
|
+
className={`relative h-[10rem] w-full p-[2px] transition-all duration-300 ${
|
|
1370
|
+
isSelected
|
|
1371
|
+
? "bg-yellow-400 shadow-[0_0_28px_rgba(250,204,21,0.32)]"
|
|
1372
|
+
: sceneOverlay
|
|
1373
|
+
? "bg-white/10 hover:bg-white/35"
|
|
1374
|
+
: "bg-border/20 hover:bg-border/60"
|
|
1375
|
+
}`}
|
|
1376
|
+
style={{
|
|
1377
|
+
clipPath: rosterSlantClipPath,
|
|
1378
|
+
}}
|
|
1379
|
+
>
|
|
1380
|
+
<div
|
|
1381
|
+
className="relative h-full w-full overflow-hidden"
|
|
1382
|
+
style={{
|
|
1383
|
+
clipPath: rosterSlantClipPath,
|
|
1384
|
+
}}
|
|
1385
|
+
>
|
|
1386
|
+
{isSelected && (
|
|
1387
|
+
<div
|
|
1388
|
+
className="pointer-events-none absolute -inset-3 bg-yellow-300/15 blur-xl"
|
|
1389
|
+
style={{ clipPath: rosterSlantClipPath }}
|
|
1390
|
+
/>
|
|
1391
|
+
)}
|
|
1392
|
+
<img
|
|
1393
|
+
src={getVrmPreviewUrl(entry.avatarIndex)}
|
|
1394
|
+
alt={entry.name}
|
|
1395
|
+
className={`h-full w-full object-cover transition-transform duration-300 ease-out ${
|
|
1396
|
+
isSelected
|
|
1397
|
+
? "scale-[1.04]"
|
|
1398
|
+
: "scale-100 group-hover:scale-[1.02]"
|
|
1399
|
+
}`}
|
|
1400
|
+
/>
|
|
1401
|
+
<div className="absolute inset-x-0 bottom-0">
|
|
1402
|
+
<div
|
|
1403
|
+
className={`px-2 py-1 text-sm font-semibold text-white transition-all ${
|
|
1404
|
+
isSelected
|
|
1405
|
+
? "bg-black/78 shadow-[inset_0_1px_0_rgba(255,255,255,0.08)]"
|
|
1406
|
+
: "bg-black/62"
|
|
1407
|
+
}`}
|
|
1408
|
+
style={{
|
|
1409
|
+
clipPath: insetShadowClipPath,
|
|
1410
|
+
}}
|
|
1411
|
+
>
|
|
1412
|
+
{entry.name}
|
|
1413
|
+
</div>
|
|
1414
|
+
</div>
|
|
1415
|
+
</div>
|
|
1416
|
+
</div>
|
|
1417
|
+
</button>
|
|
1418
|
+
);
|
|
1419
|
+
})
|
|
1420
|
+
) : (
|
|
1421
|
+
<div className="rounded-2xl border border-border/40 bg-black/10 p-4 text-sm text-muted">
|
|
1422
|
+
Loading character presets...
|
|
1423
|
+
</div>
|
|
1424
|
+
)}
|
|
1425
|
+
</div>
|
|
1426
|
+
</div>
|
|
1427
|
+
</div>
|
|
1428
|
+
) : null}
|
|
1429
|
+
|
|
1430
|
+
{customOverridesEnabled && (
|
|
1431
|
+
<div className="mt-3 flex flex-col gap-4">
|
|
1432
|
+
<div
|
|
1433
|
+
className="flex items-center justify-start"
|
|
1434
|
+
data-testid="character-edit-toolbar"
|
|
1435
|
+
>
|
|
1436
|
+
<div className="inline-flex items-center gap-2">
|
|
1437
|
+
<Button
|
|
1438
|
+
type="button"
|
|
1439
|
+
variant={customizeStep === "core" ? "default" : "outline"}
|
|
1440
|
+
size="sm"
|
|
1441
|
+
className="h-8 rounded-lg px-3 text-xs font-semibold"
|
|
1442
|
+
onClick={() => setCustomizeStep("core")}
|
|
1443
|
+
>
|
|
1444
|
+
{t("characterview.core")}
|
|
1445
|
+
</Button>
|
|
1446
|
+
<Button
|
|
1447
|
+
type="button"
|
|
1448
|
+
variant={customizeStep === "style" ? "default" : "outline"}
|
|
1449
|
+
size="sm"
|
|
1450
|
+
className="h-8 rounded-lg px-3 text-xs font-semibold xl:hidden"
|
|
1451
|
+
onClick={() => setCustomizeStep("style")}
|
|
1452
|
+
>
|
|
1453
|
+
{t("characterview.style")}
|
|
1454
|
+
</Button>
|
|
1455
|
+
<Button
|
|
1456
|
+
type="button"
|
|
1457
|
+
variant={customizeStep === "examples" ? "default" : "outline"}
|
|
1458
|
+
size="sm"
|
|
1459
|
+
className="h-8 rounded-lg px-3 text-xs font-semibold"
|
|
1460
|
+
onClick={() => setCustomizeStep("examples")}
|
|
1461
|
+
>
|
|
1462
|
+
{t("characterview.examples")}
|
|
1463
|
+
</Button>
|
|
1464
|
+
</div>
|
|
1465
|
+
</div>
|
|
1466
|
+
|
|
1467
|
+
{customizeStep === "examples" ? (
|
|
1468
|
+
<div
|
|
1469
|
+
className="grid min-h-0 grid-cols-1 gap-4 xl:grid-cols-[minmax(0,26rem)_minmax(0,1fr)_minmax(0,24rem)] xl:items-start xl:gap-6"
|
|
1470
|
+
data-testid="character-examples-grid"
|
|
1471
|
+
>
|
|
1472
|
+
{chatExamplesPanel}
|
|
1473
|
+
<div aria-hidden className="hidden xl:block" />
|
|
1474
|
+
{postExamplesPanel}
|
|
1475
|
+
</div>
|
|
1476
|
+
) : (
|
|
1477
|
+
<div
|
|
1478
|
+
className="grid min-h-0 grid-cols-1 gap-4 xl:grid-cols-[minmax(0,23rem)_minmax(0,1fr)_minmax(0,32rem)] xl:items-start xl:gap-6"
|
|
1479
|
+
data-testid="character-customize-grid"
|
|
1480
|
+
>
|
|
1481
|
+
<div
|
|
1482
|
+
className={
|
|
1483
|
+
customizeStep === "style" ? "hidden xl:block" : "block"
|
|
1484
|
+
}
|
|
1485
|
+
>
|
|
1486
|
+
{coreFieldsPanel}
|
|
1487
|
+
</div>
|
|
1488
|
+
<div aria-hidden className="hidden xl:block" />
|
|
1489
|
+
<div
|
|
1490
|
+
className={
|
|
1491
|
+
customizeStep === "core" ? "hidden xl:block" : "block"
|
|
1492
|
+
}
|
|
1493
|
+
>
|
|
1494
|
+
{styleEditorPanel}
|
|
1495
|
+
</div>
|
|
1496
|
+
</div>
|
|
1497
|
+
)}
|
|
1498
|
+
</div>
|
|
1499
|
+
)}
|
|
1500
|
+
|
|
1501
|
+
<div className={`${sectionCls} relative z-10`}>
|
|
1502
|
+
{(characterSaveSuccess || combinedSaveError) && (
|
|
1503
|
+
<div className="mb-3 flex flex-wrap items-center justify-center gap-2">
|
|
1504
|
+
{characterSaveSuccess && (
|
|
1505
|
+
<span className="rounded-lg border border-green-400/20 bg-green-400/10 px-3 py-1.5 text-xs font-bold text-green-400">
|
|
1506
|
+
{characterSaveSuccess}
|
|
1507
|
+
</span>
|
|
1508
|
+
)}
|
|
1509
|
+
{combinedSaveError && (
|
|
1510
|
+
<span className="rounded-lg border border-danger/20 bg-danger/10 px-3 py-1.5 text-xs font-medium text-danger">
|
|
1511
|
+
{combinedSaveError}
|
|
1512
|
+
</span>
|
|
1513
|
+
)}
|
|
1514
|
+
</div>
|
|
1515
|
+
)}
|
|
1516
|
+
|
|
1517
|
+
<div className="relative flex flex-col gap-3 md:min-h-10 md:flex-row md:items-center md:justify-between">
|
|
1518
|
+
<div className="flex items-center justify-center md:justify-start">
|
|
1519
|
+
{!customOverridesEnabled && (
|
|
1520
|
+
<div
|
|
1521
|
+
className="flex min-w-0 items-center gap-2"
|
|
1522
|
+
data-testid="character-voice-picker"
|
|
1523
|
+
>
|
|
1524
|
+
<Button
|
|
1525
|
+
type="button"
|
|
1526
|
+
variant={voiceSelectionLocked ? "default" : "outline"}
|
|
1527
|
+
size="icon"
|
|
1528
|
+
className="h-8 w-8 rounded-full border-border/50 bg-bg/65 p-0 shadow-inner backdrop-blur-sm"
|
|
1529
|
+
onClick={() => setVoiceSelectionLocked((value) => !value)}
|
|
1530
|
+
aria-label={
|
|
1531
|
+
voiceSelectionLocked
|
|
1532
|
+
? "Unlock voice selection"
|
|
1533
|
+
: "Lock voice selection"
|
|
1534
|
+
}
|
|
1535
|
+
title={
|
|
1536
|
+
voiceSelectionLocked
|
|
1537
|
+
? "Voice stays pinned when switching characters"
|
|
1538
|
+
: "Lock current voice"
|
|
1539
|
+
}
|
|
1540
|
+
>
|
|
1541
|
+
{voiceSelectionLocked ? (
|
|
1542
|
+
<Lock className="h-3.5 w-3.5" />
|
|
1543
|
+
) : (
|
|
1544
|
+
<LockOpen className="h-3.5 w-3.5" />
|
|
1545
|
+
)}
|
|
1546
|
+
</Button>
|
|
1547
|
+
<ThemedSelect
|
|
1548
|
+
value={voiceSelectValue}
|
|
1549
|
+
groups={VOICE_SELECT_GROUPS}
|
|
1550
|
+
onChange={(id) => {
|
|
1551
|
+
const preset = PREMADE_VOICES.find(
|
|
1552
|
+
(voicePreset) => voicePreset.id === id,
|
|
1553
|
+
);
|
|
1554
|
+
if (preset) handleSelectPreset(preset);
|
|
1555
|
+
}}
|
|
1556
|
+
placeholder={t("characterview.selectAVoice")}
|
|
1557
|
+
menuPlacement="top"
|
|
1558
|
+
className="w-[11rem] max-w-[58vw]"
|
|
1559
|
+
triggerClassName="h-8 rounded-full border-border/50 bg-bg/65 px-4 py-0 text-[11px] shadow-inner backdrop-blur-sm"
|
|
1560
|
+
menuClassName="border-border/60 bg-bg/92 shadow-2xl backdrop-blur-md"
|
|
1561
|
+
/>
|
|
1562
|
+
<Button
|
|
1563
|
+
type="button"
|
|
1564
|
+
variant={voiceTesting ? "destructive" : "outline"}
|
|
1565
|
+
size="icon"
|
|
1566
|
+
className="h-8 w-8 rounded-full border-border/50 bg-bg/65 p-0 shadow-inner backdrop-blur-sm"
|
|
1567
|
+
onClick={() =>
|
|
1568
|
+
voiceTesting
|
|
1569
|
+
? handleStopTest()
|
|
1570
|
+
: activeVoicePreset
|
|
1571
|
+
? handleTestVoice(activeVoicePreset.previewUrl)
|
|
1572
|
+
: undefined
|
|
1573
|
+
}
|
|
1574
|
+
aria-label={
|
|
1575
|
+
voiceTesting ? "Stop voice preview" : "Preview voice"
|
|
1576
|
+
}
|
|
1577
|
+
title={voiceTesting ? "Stop voice preview" : "Preview voice"}
|
|
1578
|
+
disabled={!activeVoicePreset || voiceLoading}
|
|
1579
|
+
>
|
|
1580
|
+
{voiceTesting ? (
|
|
1581
|
+
<VolumeX className="h-3.5 w-3.5" />
|
|
1582
|
+
) : (
|
|
1583
|
+
<Volume2 className="h-3.5 w-3.5" />
|
|
1584
|
+
)}
|
|
1585
|
+
</Button>
|
|
1586
|
+
</div>
|
|
1587
|
+
)}
|
|
1588
|
+
</div>
|
|
1589
|
+
|
|
1590
|
+
<div className="flex items-center justify-center md:absolute md:left-1/2 md:top-1/2 md:z-10 md:-translate-x-1/2 md:-translate-y-1/2">
|
|
1591
|
+
<Button
|
|
1592
|
+
size="lg"
|
|
1593
|
+
className="rounded-xl px-8 text-[13px] font-bold tracking-wider shadow-[0_0_15px_rgba(var(--accent),0.2)] transition-all hover:shadow-[0_0_20px_rgba(var(--accent),0.4)]"
|
|
1594
|
+
disabled={characterSaving || voiceSaving}
|
|
1595
|
+
onClick={() => void handleSaveAll()}
|
|
1596
|
+
>
|
|
1597
|
+
{characterSaving || voiceSaving ? "saving..." : "Save Character"}
|
|
1598
|
+
</Button>
|
|
1599
|
+
</div>
|
|
1600
|
+
|
|
1601
|
+
<div className="flex items-center justify-center md:justify-end">
|
|
1602
|
+
<Button
|
|
1603
|
+
type="button"
|
|
1604
|
+
variant={customOverridesEnabled ? "outline" : "default"}
|
|
1605
|
+
size="sm"
|
|
1606
|
+
className={`h-10 rounded-xl px-4 text-sm font-semibold ${
|
|
1607
|
+
customOverridesEnabled
|
|
1608
|
+
? "border-border/40 bg-bg/40 text-txt"
|
|
1609
|
+
: "shadow-[0_0_18px_rgba(var(--accent),0.18)]"
|
|
1610
|
+
}`}
|
|
1611
|
+
onClick={() =>
|
|
1612
|
+
handleCustomOverridesChange(!customOverridesEnabled)
|
|
1613
|
+
}
|
|
1614
|
+
data-testid="character-customize-toggle"
|
|
1615
|
+
>
|
|
1616
|
+
{customizationActionLabel}
|
|
1617
|
+
</Button>
|
|
1618
|
+
</div>
|
|
1619
|
+
</div>
|
|
1620
|
+
</div>
|
|
1621
|
+
</div>
|
|
1622
|
+
);
|
|
1623
|
+
}
|