@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,1168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* E2E tests for Character Customization (CharacterView).
|
|
3
|
+
*
|
|
4
|
+
* Tests cover:
|
|
5
|
+
* 1. Identity editing (name, bio, system prompt)
|
|
6
|
+
* 2. Voice picker placement and editing layout
|
|
7
|
+
* 3. Style configuration
|
|
8
|
+
* 4. Avatar selection
|
|
9
|
+
* 5. Save functionality
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import http from "node:http";
|
|
13
|
+
// @vitest-environment jsdom
|
|
14
|
+
import React from "react";
|
|
15
|
+
import TestRenderer, { act } from "react-test-renderer";
|
|
16
|
+
import {
|
|
17
|
+
afterAll,
|
|
18
|
+
beforeAll,
|
|
19
|
+
beforeEach,
|
|
20
|
+
describe,
|
|
21
|
+
expect,
|
|
22
|
+
it,
|
|
23
|
+
vi,
|
|
24
|
+
} from "vitest";
|
|
25
|
+
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// Part 1: API Tests for Character Endpoints
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
async function req(
|
|
31
|
+
port: number,
|
|
32
|
+
method: string,
|
|
33
|
+
path: string,
|
|
34
|
+
body?: Record<string, unknown>,
|
|
35
|
+
): Promise<{ status: number; data: Record<string, unknown> }> {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
const payload = body ? JSON.stringify(body) : undefined;
|
|
38
|
+
const r = http.request(
|
|
39
|
+
{
|
|
40
|
+
hostname: "127.0.0.1",
|
|
41
|
+
port,
|
|
42
|
+
path,
|
|
43
|
+
method,
|
|
44
|
+
headers: {
|
|
45
|
+
"Content-Type": "application/json",
|
|
46
|
+
...(payload ? { "Content-Length": Buffer.byteLength(payload) } : {}),
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
(res) => {
|
|
50
|
+
const chunks: Buffer[] = [];
|
|
51
|
+
res.on("data", (c: Buffer) => chunks.push(c));
|
|
52
|
+
res.on("end", () => {
|
|
53
|
+
const raw = Buffer.concat(chunks).toString("utf-8");
|
|
54
|
+
let data: Record<string, unknown> = {};
|
|
55
|
+
try {
|
|
56
|
+
data = JSON.parse(raw) as Record<string, unknown>;
|
|
57
|
+
} catch {
|
|
58
|
+
data = { _raw: raw };
|
|
59
|
+
}
|
|
60
|
+
resolve({ status: res.statusCode ?? 0, data });
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
);
|
|
64
|
+
r.on("error", reject);
|
|
65
|
+
if (payload) r.write(payload);
|
|
66
|
+
r.end();
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function createCharacterTestServer(): Promise<{
|
|
71
|
+
port: number;
|
|
72
|
+
close: () => Promise<void>;
|
|
73
|
+
getCharacter: () => {
|
|
74
|
+
name: string;
|
|
75
|
+
bio: string[];
|
|
76
|
+
system: string;
|
|
77
|
+
adjectives: string[];
|
|
78
|
+
style: { all: string[]; chat: string[]; post: string[] };
|
|
79
|
+
};
|
|
80
|
+
}> {
|
|
81
|
+
const character = {
|
|
82
|
+
name: "TestAgent",
|
|
83
|
+
bio: ["A helpful AI assistant"],
|
|
84
|
+
system: "You are a helpful assistant",
|
|
85
|
+
adjectives: ["friendly", "helpful"],
|
|
86
|
+
style: {
|
|
87
|
+
all: ["Be concise"],
|
|
88
|
+
chat: ["Use casual tone"],
|
|
89
|
+
post: ["Be informative"],
|
|
90
|
+
},
|
|
91
|
+
avatar: 1,
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const json = (res: http.ServerResponse, data: unknown, status = 200) => {
|
|
95
|
+
res.writeHead(status, {
|
|
96
|
+
"Content-Type": "application/json",
|
|
97
|
+
"Access-Control-Allow-Origin": "*",
|
|
98
|
+
});
|
|
99
|
+
res.end(JSON.stringify(data));
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const readBody = (r: http.IncomingMessage): Promise<string> =>
|
|
103
|
+
new Promise((ok) => {
|
|
104
|
+
const c: Buffer[] = [];
|
|
105
|
+
r.on("data", (d: Buffer) => c.push(d));
|
|
106
|
+
r.on("end", () => ok(Buffer.concat(c).toString()));
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const routes: Record<
|
|
110
|
+
string,
|
|
111
|
+
(
|
|
112
|
+
req: http.IncomingMessage,
|
|
113
|
+
res: http.ServerResponse,
|
|
114
|
+
) => Promise<void> | void
|
|
115
|
+
> = {
|
|
116
|
+
"GET /api/character": (_r, res) => json(res, { character }),
|
|
117
|
+
"PUT /api/character": async (r, res) => {
|
|
118
|
+
const body = JSON.parse(await readBody(r)) as Record<string, unknown>;
|
|
119
|
+
if (body.name) character.name = body.name as string;
|
|
120
|
+
if (body.bio) character.bio = body.bio as string[];
|
|
121
|
+
if (body.system) character.system = body.system as string;
|
|
122
|
+
if (body.adjectives) character.adjectives = body.adjectives as string[];
|
|
123
|
+
if (body.style) character.style = body.style as typeof character.style;
|
|
124
|
+
if (body.avatar !== undefined) character.avatar = body.avatar as number;
|
|
125
|
+
json(res, { ok: true, character });
|
|
126
|
+
},
|
|
127
|
+
"PATCH /api/character": async (r, res) => {
|
|
128
|
+
const body = JSON.parse(await readBody(r)) as Record<string, unknown>;
|
|
129
|
+
Object.assign(character, body);
|
|
130
|
+
json(res, { ok: true, character });
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const server = http.createServer(async (rq, rs) => {
|
|
135
|
+
if (rq.method === "OPTIONS") {
|
|
136
|
+
rs.writeHead(204, {
|
|
137
|
+
"Access-Control-Allow-Origin": "*",
|
|
138
|
+
"Access-Control-Allow-Methods": "*",
|
|
139
|
+
"Access-Control-Allow-Headers": "*",
|
|
140
|
+
});
|
|
141
|
+
rs.end();
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const key = `${rq.method} ${new URL(rq.url ?? "/", "http://localhost").pathname}`;
|
|
145
|
+
const handler = routes[key];
|
|
146
|
+
if (handler) {
|
|
147
|
+
await handler(rq, rs);
|
|
148
|
+
} else {
|
|
149
|
+
json(rs, { error: "Not found" }, 404);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
return new Promise((ok) => {
|
|
154
|
+
server.listen(0, "127.0.0.1", () => {
|
|
155
|
+
const addr = server.address();
|
|
156
|
+
ok({
|
|
157
|
+
port: typeof addr === "object" && addr ? addr.port : 0,
|
|
158
|
+
close: () => new Promise<void>((r) => server.close(() => r())),
|
|
159
|
+
getCharacter: () => ({
|
|
160
|
+
name: character.name,
|
|
161
|
+
bio: character.bio,
|
|
162
|
+
system: character.system,
|
|
163
|
+
adjectives: character.adjectives,
|
|
164
|
+
style: character.style,
|
|
165
|
+
}),
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
describe("Character API", () => {
|
|
172
|
+
let port: number;
|
|
173
|
+
let close: () => Promise<void>;
|
|
174
|
+
let getCharacter: ReturnType<
|
|
175
|
+
typeof createCharacterTestServer
|
|
176
|
+
> extends Promise<infer T>
|
|
177
|
+
? T["getCharacter"]
|
|
178
|
+
: never;
|
|
179
|
+
|
|
180
|
+
beforeAll(async () => {
|
|
181
|
+
({ port, close, getCharacter } = await createCharacterTestServer());
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
afterAll(async () => {
|
|
185
|
+
await close();
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it("GET /api/character returns character data", async () => {
|
|
189
|
+
const { status, data } = await req(port, "GET", "/api/character");
|
|
190
|
+
expect(status).toBe(200);
|
|
191
|
+
expect(data.character).toBeDefined();
|
|
192
|
+
const char = data.character as Record<string, unknown>;
|
|
193
|
+
expect(char.name).toBe("TestAgent");
|
|
194
|
+
expect(Array.isArray(char.bio)).toBe(true);
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
it("PUT /api/character updates name", async () => {
|
|
198
|
+
const { status, data } = await req(port, "PUT", "/api/character", {
|
|
199
|
+
name: "UpdatedAgent",
|
|
200
|
+
});
|
|
201
|
+
expect(status).toBe(200);
|
|
202
|
+
expect(data.ok).toBe(true);
|
|
203
|
+
expect(getCharacter().name).toBe("UpdatedAgent");
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it("PUT /api/character updates bio", async () => {
|
|
207
|
+
const newBio = ["First line", "Second line"];
|
|
208
|
+
const { status } = await req(port, "PUT", "/api/character", {
|
|
209
|
+
bio: newBio,
|
|
210
|
+
});
|
|
211
|
+
expect(status).toBe(200);
|
|
212
|
+
expect(getCharacter().bio).toEqual(newBio);
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it("PUT /api/character updates system prompt", async () => {
|
|
216
|
+
const newSystem = "You are a specialized assistant for coding tasks";
|
|
217
|
+
const { status } = await req(port, "PUT", "/api/character", {
|
|
218
|
+
system: newSystem,
|
|
219
|
+
});
|
|
220
|
+
expect(status).toBe(200);
|
|
221
|
+
expect(getCharacter().system).toBe(newSystem);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it("PUT /api/character updates adjectives", async () => {
|
|
225
|
+
const newAdj = ["creative", "analytical", "patient"];
|
|
226
|
+
const { status } = await req(port, "PUT", "/api/character", {
|
|
227
|
+
adjectives: newAdj,
|
|
228
|
+
});
|
|
229
|
+
expect(status).toBe(200);
|
|
230
|
+
expect(getCharacter().adjectives).toEqual(newAdj);
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
it("PUT /api/character updates style rules", async () => {
|
|
234
|
+
const newStyle = {
|
|
235
|
+
all: ["Be precise", "Use examples"],
|
|
236
|
+
chat: ["Keep it casual"],
|
|
237
|
+
post: ["Be thorough"],
|
|
238
|
+
};
|
|
239
|
+
const { status } = await req(port, "PUT", "/api/character", {
|
|
240
|
+
style: newStyle,
|
|
241
|
+
});
|
|
242
|
+
expect(status).toBe(200);
|
|
243
|
+
expect(getCharacter().style).toEqual(newStyle);
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
it("PATCH /api/character partially updates character", async () => {
|
|
247
|
+
const { status } = await req(port, "PATCH", "/api/character", {
|
|
248
|
+
name: "PartialUpdate",
|
|
249
|
+
});
|
|
250
|
+
expect(status).toBe(200);
|
|
251
|
+
expect(getCharacter().name).toBe("PartialUpdate");
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
// ---------------------------------------------------------------------------
|
|
256
|
+
// Part 2: UI Tests for CharacterView
|
|
257
|
+
// ---------------------------------------------------------------------------
|
|
258
|
+
|
|
259
|
+
const { mockUseApp } = vi.hoisted(() => ({
|
|
260
|
+
mockUseApp: vi.fn(),
|
|
261
|
+
}));
|
|
262
|
+
|
|
263
|
+
vi.mock("@elizaos/app-core/state", async () => {
|
|
264
|
+
const actual = await vi.importActual("@elizaos/app-core/state");
|
|
265
|
+
return {
|
|
266
|
+
...actual,
|
|
267
|
+
useApp: () => mockUseApp(),
|
|
268
|
+
};
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
vi.mock("@elizaos/app-core/api", () => ({
|
|
272
|
+
client: {
|
|
273
|
+
getCharacter: vi.fn().mockResolvedValue({
|
|
274
|
+
name: "TestAgent",
|
|
275
|
+
bio: ["Bio line 1"],
|
|
276
|
+
system: "System prompt",
|
|
277
|
+
adjectives: ["friendly"],
|
|
278
|
+
style: { all: [], chat: [], post: [] },
|
|
279
|
+
}),
|
|
280
|
+
getConfig: vi.fn().mockResolvedValue({
|
|
281
|
+
messages: {
|
|
282
|
+
tts: {
|
|
283
|
+
provider: "elevenlabs",
|
|
284
|
+
elevenlabs: { voiceId: "EXAVITQu4vr4xnSDxMaL" },
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
}),
|
|
288
|
+
updateConfig: vi.fn().mockResolvedValue({ ok: true }),
|
|
289
|
+
getOnboardingOptions: vi.fn().mockResolvedValue({
|
|
290
|
+
styles: [],
|
|
291
|
+
}),
|
|
292
|
+
updateCharacter: vi.fn().mockResolvedValue({
|
|
293
|
+
ok: true,
|
|
294
|
+
character: {},
|
|
295
|
+
agentName: "TestAgent",
|
|
296
|
+
}),
|
|
297
|
+
},
|
|
298
|
+
}));
|
|
299
|
+
|
|
300
|
+
vi.mock("../../src/components/AvatarSelector", () => ({
|
|
301
|
+
AvatarSelector: ({
|
|
302
|
+
value,
|
|
303
|
+
onChange,
|
|
304
|
+
}: {
|
|
305
|
+
value: number;
|
|
306
|
+
onChange: (v: number) => void;
|
|
307
|
+
}) =>
|
|
308
|
+
React.createElement(
|
|
309
|
+
"div",
|
|
310
|
+
{ "data-testid": "avatar-selector" },
|
|
311
|
+
React.createElement(
|
|
312
|
+
"button",
|
|
313
|
+
{ type: "button", onClick: () => onChange(2) },
|
|
314
|
+
`Avatar ${value}`,
|
|
315
|
+
),
|
|
316
|
+
),
|
|
317
|
+
}));
|
|
318
|
+
|
|
319
|
+
vi.mock("@elizaos/app-core/config", () => ({
|
|
320
|
+
ConfigRenderer: () => React.createElement("div", null, "ConfigRenderer"),
|
|
321
|
+
defaultRegistry: {},
|
|
322
|
+
}));
|
|
323
|
+
|
|
324
|
+
import { client } from "@elizaos/app-core/api";
|
|
325
|
+
import { CharacterView } from "../../src/components/CharacterView";
|
|
326
|
+
|
|
327
|
+
type CharacterData = {
|
|
328
|
+
name: string;
|
|
329
|
+
username?: string;
|
|
330
|
+
bio: string | string[];
|
|
331
|
+
system: string;
|
|
332
|
+
adjectives: string[];
|
|
333
|
+
style: { all: string[]; chat: string[]; post: string[] };
|
|
334
|
+
messageExamples?: Array<{
|
|
335
|
+
examples: Array<{ name: string; content: { text: string } }>;
|
|
336
|
+
}>;
|
|
337
|
+
postExamples?: string[];
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
type CharacterState = {
|
|
341
|
+
tab: "character" | "character-select";
|
|
342
|
+
characterLoading: boolean;
|
|
343
|
+
characterData: CharacterData | null;
|
|
344
|
+
characterDraft: CharacterData | null;
|
|
345
|
+
characterSaving: boolean;
|
|
346
|
+
characterDirty: boolean;
|
|
347
|
+
characterSaveSuccess: string | null;
|
|
348
|
+
characterSaveError: string | null;
|
|
349
|
+
selectedVrmIndex: number;
|
|
350
|
+
onboardingOptions: {
|
|
351
|
+
styles: Array<{
|
|
352
|
+
catchphrase: string;
|
|
353
|
+
hint: string;
|
|
354
|
+
bio: string[];
|
|
355
|
+
system: string;
|
|
356
|
+
adjectives: string[];
|
|
357
|
+
style: { all: string[]; chat: string[]; post: string[] };
|
|
358
|
+
postExamples: string[];
|
|
359
|
+
messageExamples: Array<
|
|
360
|
+
Array<{ user: string; content: { text: string } }>
|
|
361
|
+
>;
|
|
362
|
+
}>;
|
|
363
|
+
} | null;
|
|
364
|
+
registryStatus: null;
|
|
365
|
+
registryLoading: boolean;
|
|
366
|
+
registryRegistering: boolean;
|
|
367
|
+
registryError: string | null;
|
|
368
|
+
dropStatus: null;
|
|
369
|
+
mintInProgress: boolean;
|
|
370
|
+
mintResult: null;
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
function createCharacterUIState(): CharacterState {
|
|
374
|
+
const charData: CharacterData = {
|
|
375
|
+
name: "Reimu",
|
|
376
|
+
username: "Reimu",
|
|
377
|
+
bio: ["Reimu is soft and friendly"],
|
|
378
|
+
system: "You are Reimu",
|
|
379
|
+
adjectives: ["friendly", "helpful"],
|
|
380
|
+
style: { all: ["Rule 1"], chat: ["Chat rule"], post: ["Post rule"] },
|
|
381
|
+
messageExamples: [
|
|
382
|
+
{
|
|
383
|
+
examples: [
|
|
384
|
+
{ name: "{{user1}}", content: { text: "hi" } },
|
|
385
|
+
{ name: "Reimu", content: { text: "hey" } },
|
|
386
|
+
],
|
|
387
|
+
},
|
|
388
|
+
],
|
|
389
|
+
postExamples: [],
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
return {
|
|
393
|
+
tab: "character-select",
|
|
394
|
+
characterLoading: false,
|
|
395
|
+
characterData: charData,
|
|
396
|
+
characterDraft: { ...charData },
|
|
397
|
+
characterSaving: false,
|
|
398
|
+
characterDirty: false,
|
|
399
|
+
characterSaveSuccess: null,
|
|
400
|
+
characterSaveError: null,
|
|
401
|
+
selectedVrmIndex: 1,
|
|
402
|
+
onboardingOptions: {
|
|
403
|
+
styles: [
|
|
404
|
+
{
|
|
405
|
+
catchphrase: "uwu~",
|
|
406
|
+
hint: "soft & sweet",
|
|
407
|
+
bio: ["{{name}} is soft and friendly"],
|
|
408
|
+
system: "You are {{name}}",
|
|
409
|
+
adjectives: ["friendly", "helpful"],
|
|
410
|
+
style: { all: ["Rule 1"], chat: ["Chat rule"], post: ["Post rule"] },
|
|
411
|
+
postExamples: [],
|
|
412
|
+
messageExamples: [
|
|
413
|
+
[
|
|
414
|
+
{ user: "{{user1}}", content: { text: "hi" } },
|
|
415
|
+
{ user: "{{agentName}}", content: { text: "hey" } },
|
|
416
|
+
],
|
|
417
|
+
],
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
catchphrase: "Noted.",
|
|
421
|
+
hint: "composed & precise",
|
|
422
|
+
bio: ["{{name}} is precise"],
|
|
423
|
+
system: "You are {{name}}, exact and calm.",
|
|
424
|
+
adjectives: ["precise", "calm"],
|
|
425
|
+
style: { all: ["Be exact"], chat: ["Stay calm"], post: ["Be clear"] },
|
|
426
|
+
postExamples: [],
|
|
427
|
+
messageExamples: [
|
|
428
|
+
[
|
|
429
|
+
{ user: "{{user1}}", content: { text: "status?" } },
|
|
430
|
+
{ user: "{{agentName}}", content: { text: "On track." } },
|
|
431
|
+
],
|
|
432
|
+
],
|
|
433
|
+
},
|
|
434
|
+
],
|
|
435
|
+
},
|
|
436
|
+
registryStatus: null,
|
|
437
|
+
registryLoading: false,
|
|
438
|
+
registryRegistering: false,
|
|
439
|
+
registryError: null,
|
|
440
|
+
dropStatus: null,
|
|
441
|
+
mintInProgress: false,
|
|
442
|
+
mintResult: null,
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
function prepareCharacterDraftForSave(draft: CharacterData) {
|
|
447
|
+
const prepared: Record<string, unknown> = { ...draft };
|
|
448
|
+
|
|
449
|
+
if (typeof prepared.bio === "string") {
|
|
450
|
+
const lines = prepared.bio
|
|
451
|
+
.split("\n")
|
|
452
|
+
.map((line) => line.trim())
|
|
453
|
+
.filter((line) => line.length > 0);
|
|
454
|
+
prepared.bio = lines.length > 0 ? lines : undefined;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
if (Array.isArray(prepared.adjectives) && prepared.adjectives.length === 0) {
|
|
458
|
+
delete prepared.adjectives;
|
|
459
|
+
}
|
|
460
|
+
if (
|
|
461
|
+
Array.isArray(prepared.postExamples) &&
|
|
462
|
+
prepared.postExamples.length === 0
|
|
463
|
+
) {
|
|
464
|
+
delete prepared.postExamples;
|
|
465
|
+
}
|
|
466
|
+
if (
|
|
467
|
+
Array.isArray(prepared.messageExamples) &&
|
|
468
|
+
prepared.messageExamples.length === 0
|
|
469
|
+
) {
|
|
470
|
+
delete prepared.messageExamples;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
if (prepared.style && typeof prepared.style === "object") {
|
|
474
|
+
const style = prepared.style as Record<string, string[] | undefined>;
|
|
475
|
+
if (style.all && style.all.length === 0) delete style.all;
|
|
476
|
+
if (style.chat && style.chat.length === 0) delete style.chat;
|
|
477
|
+
if (style.post && style.post.length === 0) delete style.post;
|
|
478
|
+
if (!style.all && !style.chat && !style.post) delete prepared.style;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
if (prepared.name) prepared.username = prepared.name;
|
|
482
|
+
if (!prepared.name) delete prepared.name;
|
|
483
|
+
if (!prepared.username) delete prepared.username;
|
|
484
|
+
if (!prepared.system) delete prepared.system;
|
|
485
|
+
|
|
486
|
+
return prepared;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
describe("CharacterView UI", () => {
|
|
490
|
+
let state: CharacterState;
|
|
491
|
+
let _saveCharacterCalled: boolean;
|
|
492
|
+
|
|
493
|
+
beforeEach(() => {
|
|
494
|
+
state = createCharacterUIState();
|
|
495
|
+
_saveCharacterCalled = false;
|
|
496
|
+
vi.mocked(client.updateCharacter).mockClear();
|
|
497
|
+
vi.mocked(client.updateConfig).mockClear();
|
|
498
|
+
|
|
499
|
+
mockUseApp.mockReset();
|
|
500
|
+
mockUseApp.mockImplementation(() => ({
|
|
501
|
+
uiLanguage: "en",
|
|
502
|
+
t: (k: string) => k,
|
|
503
|
+
...state,
|
|
504
|
+
setTab: vi.fn((tab: CharacterState["tab"]) => {
|
|
505
|
+
state.tab = tab;
|
|
506
|
+
}),
|
|
507
|
+
loadCharacter: vi.fn(),
|
|
508
|
+
loadRegistryStatus: vi.fn(),
|
|
509
|
+
loadDropStatus: vi.fn(),
|
|
510
|
+
handleSaveCharacter: async () => {
|
|
511
|
+
_saveCharacterCalled = true;
|
|
512
|
+
state.characterSaving = false;
|
|
513
|
+
state.characterDirty = false;
|
|
514
|
+
},
|
|
515
|
+
handleCharacterFieldInput: (field: string, value: unknown) => {
|
|
516
|
+
if (state.characterDraft) {
|
|
517
|
+
(state.characterDraft as Record<string, unknown>)[field] = value;
|
|
518
|
+
state.characterDirty = true;
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
handleCharacterArrayInput: vi.fn(),
|
|
522
|
+
handleCharacterStyleInput: vi.fn(),
|
|
523
|
+
setState: vi.fn((key: string, value: unknown) => {
|
|
524
|
+
(state as Record<string, unknown>)[key] = value;
|
|
525
|
+
}),
|
|
526
|
+
}));
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
it("renders CharacterView with character name", async () => {
|
|
530
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
531
|
+
|
|
532
|
+
await act(async () => {
|
|
533
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
expect(tree).not.toBeNull();
|
|
537
|
+
const json = tree?.toJSON();
|
|
538
|
+
expect(json).not.toBeNull();
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
it("renders the character roster as a single full-width row without a separate current character card", async () => {
|
|
542
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
543
|
+
|
|
544
|
+
await act(async () => {
|
|
545
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
const roster = tree?.root.find(
|
|
549
|
+
(node) => node.props["data-testid"] === "character-roster-grid",
|
|
550
|
+
);
|
|
551
|
+
expect(roster).toBeDefined();
|
|
552
|
+
expect(roster?.props.className).toContain("overflow-hidden");
|
|
553
|
+
|
|
554
|
+
expect(
|
|
555
|
+
tree?.root.findAll(
|
|
556
|
+
(node) => node.props["data-testid"] === "character-current-card",
|
|
557
|
+
) ?? [],
|
|
558
|
+
).toHaveLength(0);
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
it("anchors the scene overlay layout to the bottom of the viewport", async () => {
|
|
562
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
563
|
+
|
|
564
|
+
await act(async () => {
|
|
565
|
+
tree = TestRenderer.create(
|
|
566
|
+
React.createElement(CharacterView, { sceneOverlay: true }),
|
|
567
|
+
);
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
const json = tree?.toJSON();
|
|
571
|
+
expect(json).not.toBeNull();
|
|
572
|
+
expect(
|
|
573
|
+
json &&
|
|
574
|
+
!Array.isArray(json) &&
|
|
575
|
+
typeof json.props.className === "string" &&
|
|
576
|
+
json.props.className.includes("min-h-full"),
|
|
577
|
+
).toBe(true);
|
|
578
|
+
expect(
|
|
579
|
+
json &&
|
|
580
|
+
!Array.isArray(json) &&
|
|
581
|
+
typeof json.props.className === "string" &&
|
|
582
|
+
json.props.className.includes("justify-end"),
|
|
583
|
+
).toBe(true);
|
|
584
|
+
});
|
|
585
|
+
|
|
586
|
+
it("starts in roster mode even when the saved draft differs from the selected preset", async () => {
|
|
587
|
+
state.characterDraft = {
|
|
588
|
+
...(state.characterDraft as CharacterData),
|
|
589
|
+
system: "Custom system override",
|
|
590
|
+
};
|
|
591
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
592
|
+
|
|
593
|
+
await act(async () => {
|
|
594
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
expect(
|
|
598
|
+
tree?.root.findAll(
|
|
599
|
+
(node) => node.props["data-testid"] === "character-customize-grid",
|
|
600
|
+
) ?? [],
|
|
601
|
+
).toHaveLength(0);
|
|
602
|
+
expect(state.characterDraft?.name).toBe("Reimu");
|
|
603
|
+
expect(state.characterDraft?.bio).toEqual(["Reimu is soft and friendly"]);
|
|
604
|
+
expect(state.characterDraft?.system).toBe("Custom system override");
|
|
605
|
+
expect(state.selectedVrmIndex).toBe(1);
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
it("opens the detailed editor when explicitly routed to the character tab", async () => {
|
|
609
|
+
state.tab = "character";
|
|
610
|
+
|
|
611
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
612
|
+
|
|
613
|
+
await act(async () => {
|
|
614
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
615
|
+
});
|
|
616
|
+
|
|
617
|
+
expect(
|
|
618
|
+
tree?.root.findAll(
|
|
619
|
+
(node) => node.props["data-testid"] === "character-customize-grid",
|
|
620
|
+
) ?? [],
|
|
621
|
+
).toHaveLength(1);
|
|
622
|
+
expect(
|
|
623
|
+
tree?.root.findAll(
|
|
624
|
+
(node) => node.props["data-testid"] === "character-roster-grid",
|
|
625
|
+
) ?? [],
|
|
626
|
+
).toHaveLength(0);
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
it("removes adjective editors from the character screen", async () => {
|
|
630
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
631
|
+
|
|
632
|
+
await act(async () => {
|
|
633
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
634
|
+
});
|
|
635
|
+
|
|
636
|
+
const adjectiveLabels =
|
|
637
|
+
tree?.root.findAll((node) =>
|
|
638
|
+
node.children?.some(
|
|
639
|
+
(child) =>
|
|
640
|
+
child === "Adjectives" || child === "characterview.adjectives",
|
|
641
|
+
),
|
|
642
|
+
) ?? [];
|
|
643
|
+
|
|
644
|
+
expect(adjectiveLabels).toHaveLength(0);
|
|
645
|
+
});
|
|
646
|
+
|
|
647
|
+
it("keeps the voice picker in roster mode and hides it while customizing", async () => {
|
|
648
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
649
|
+
|
|
650
|
+
await act(async () => {
|
|
651
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
652
|
+
});
|
|
653
|
+
|
|
654
|
+
expect(
|
|
655
|
+
tree?.root.findAll(
|
|
656
|
+
(node) => node.props["data-testid"] === "character-voice-picker",
|
|
657
|
+
) ?? [],
|
|
658
|
+
).toHaveLength(1);
|
|
659
|
+
|
|
660
|
+
const customizeButton = tree?.root.find(
|
|
661
|
+
(node) => node.props["data-testid"] === "character-customize-toggle",
|
|
662
|
+
);
|
|
663
|
+
|
|
664
|
+
await act(async () => {
|
|
665
|
+
customizeButton?.props.onClick();
|
|
666
|
+
});
|
|
667
|
+
|
|
668
|
+
expect(
|
|
669
|
+
tree?.root.findAll(
|
|
670
|
+
(node) => node.props["data-testid"] === "character-roster-grid",
|
|
671
|
+
) ?? [],
|
|
672
|
+
).toHaveLength(0);
|
|
673
|
+
expect(
|
|
674
|
+
tree?.root.findAll(
|
|
675
|
+
(node) => node.props["data-testid"] === "character-voice-picker",
|
|
676
|
+
) ?? [],
|
|
677
|
+
).toHaveLength(0);
|
|
678
|
+
expect(
|
|
679
|
+
tree?.root.findAll(
|
|
680
|
+
(node) => node.props["data-testid"] === "character-customize-grid",
|
|
681
|
+
) ?? [],
|
|
682
|
+
).toHaveLength(1);
|
|
683
|
+
expect(
|
|
684
|
+
tree?.root.findAll(
|
|
685
|
+
(node) =>
|
|
686
|
+
node.props["data-testid"] === "style-section-all" ||
|
|
687
|
+
node.props["data-testid"] === "style-section-chat" ||
|
|
688
|
+
node.props["data-testid"] === "style-section-post",
|
|
689
|
+
),
|
|
690
|
+
).toHaveLength(3);
|
|
691
|
+
});
|
|
692
|
+
|
|
693
|
+
it("turning custom off applies the selected character defaults and hides the editors", async () => {
|
|
694
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
695
|
+
|
|
696
|
+
await act(async () => {
|
|
697
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
698
|
+
});
|
|
699
|
+
|
|
700
|
+
const customizeButton = tree?.root.find(
|
|
701
|
+
(node) => node.props["data-testid"] === "character-customize-toggle",
|
|
702
|
+
);
|
|
703
|
+
|
|
704
|
+
await act(async () => {
|
|
705
|
+
customizeButton?.props.onClick();
|
|
706
|
+
});
|
|
707
|
+
|
|
708
|
+
const backButton = tree?.root.find(
|
|
709
|
+
(node) => node.props["data-testid"] === "character-customize-toggle",
|
|
710
|
+
);
|
|
711
|
+
|
|
712
|
+
await act(async () => {
|
|
713
|
+
backButton?.props.onClick();
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
expect(state.characterDraft?.name).toBe("Reimu");
|
|
717
|
+
expect(state.characterDraft?.bio).toBe("Reimu is soft and friendly");
|
|
718
|
+
expect(state.characterDraft?.system).toBe("You are Reimu");
|
|
719
|
+
expect(state.selectedVrmIndex).toBe(1);
|
|
720
|
+
expect(
|
|
721
|
+
tree?.root.findAll(
|
|
722
|
+
(node) => node.props["data-testid"] === "character-customize-grid",
|
|
723
|
+
) ?? [],
|
|
724
|
+
).toHaveLength(0);
|
|
725
|
+
expect(
|
|
726
|
+
tree?.root.findAll(
|
|
727
|
+
(node) => node.props["data-testid"] === "character-roster-grid",
|
|
728
|
+
) ?? [],
|
|
729
|
+
).toHaveLength(1);
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
it("turning custom off keeps deep overrides intact", async () => {
|
|
733
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
734
|
+
|
|
735
|
+
await act(async () => {
|
|
736
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
737
|
+
});
|
|
738
|
+
|
|
739
|
+
const customizeButton = tree?.root.find(
|
|
740
|
+
(node) => node.props["data-testid"] === "character-customize-toggle",
|
|
741
|
+
);
|
|
742
|
+
|
|
743
|
+
await act(async () => {
|
|
744
|
+
customizeButton?.props.onClick();
|
|
745
|
+
});
|
|
746
|
+
|
|
747
|
+
await act(async () => {
|
|
748
|
+
state.characterDraft = {
|
|
749
|
+
...(state.characterDraft as CharacterData),
|
|
750
|
+
system: "Custom preserved system",
|
|
751
|
+
};
|
|
752
|
+
tree?.update(React.createElement(CharacterView));
|
|
753
|
+
});
|
|
754
|
+
|
|
755
|
+
const backButton = tree?.root.find(
|
|
756
|
+
(node) => node.props["data-testid"] === "character-customize-toggle",
|
|
757
|
+
);
|
|
758
|
+
|
|
759
|
+
await act(async () => {
|
|
760
|
+
backButton?.props.onClick();
|
|
761
|
+
});
|
|
762
|
+
|
|
763
|
+
expect(state.characterDraft?.system).toBe("Custom preserved system");
|
|
764
|
+
expect(
|
|
765
|
+
tree?.root.findAll(
|
|
766
|
+
(node) => node.props["data-testid"] === "character-roster-grid",
|
|
767
|
+
) ?? [],
|
|
768
|
+
).toHaveLength(1);
|
|
769
|
+
});
|
|
770
|
+
|
|
771
|
+
it("does not wipe deep overrides when switching presets after leaving custom mode", async () => {
|
|
772
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
773
|
+
|
|
774
|
+
await act(async () => {
|
|
775
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
776
|
+
});
|
|
777
|
+
|
|
778
|
+
const customizeButton = tree?.root.find(
|
|
779
|
+
(node) => node.props["data-testid"] === "character-customize-toggle",
|
|
780
|
+
);
|
|
781
|
+
|
|
782
|
+
await act(async () => {
|
|
783
|
+
customizeButton?.props.onClick();
|
|
784
|
+
});
|
|
785
|
+
|
|
786
|
+
await act(async () => {
|
|
787
|
+
state.characterDraft = {
|
|
788
|
+
...(state.characterDraft as CharacterData),
|
|
789
|
+
system: "Custom preserved system",
|
|
790
|
+
};
|
|
791
|
+
tree?.update(React.createElement(CharacterView));
|
|
792
|
+
});
|
|
793
|
+
|
|
794
|
+
const backButton = tree?.root.find(
|
|
795
|
+
(node) => node.props["data-testid"] === "character-customize-toggle",
|
|
796
|
+
);
|
|
797
|
+
|
|
798
|
+
await act(async () => {
|
|
799
|
+
backButton?.props.onClick();
|
|
800
|
+
});
|
|
801
|
+
|
|
802
|
+
const sakuyaCard = tree?.root.find(
|
|
803
|
+
(node) => node.props["data-testid"] === "character-preset-Noted.",
|
|
804
|
+
);
|
|
805
|
+
|
|
806
|
+
await act(async () => {
|
|
807
|
+
sakuyaCard?.props.onClick();
|
|
808
|
+
});
|
|
809
|
+
|
|
810
|
+
expect(state.characterDraft?.name).toBe("Reimu");
|
|
811
|
+
expect(state.characterDraft?.system).toBe("Custom preserved system");
|
|
812
|
+
expect(state.selectedVrmIndex).toBe(4);
|
|
813
|
+
});
|
|
814
|
+
|
|
815
|
+
it("hides character select while customizing and restores it when going back", async () => {
|
|
816
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
817
|
+
|
|
818
|
+
await act(async () => {
|
|
819
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
820
|
+
});
|
|
821
|
+
|
|
822
|
+
const customizeButton = tree?.root.find(
|
|
823
|
+
(node) => node.props["data-testid"] === "character-customize-toggle",
|
|
824
|
+
);
|
|
825
|
+
|
|
826
|
+
await act(async () => {
|
|
827
|
+
customizeButton?.props.onClick();
|
|
828
|
+
});
|
|
829
|
+
|
|
830
|
+
expect(
|
|
831
|
+
tree?.root.findAll(
|
|
832
|
+
(node) => node.props["data-testid"] === "character-roster-grid",
|
|
833
|
+
) ?? [],
|
|
834
|
+
).toHaveLength(0);
|
|
835
|
+
expect(
|
|
836
|
+
tree?.root.findAll(
|
|
837
|
+
(node) => node.props["data-testid"] === "character-customize-header",
|
|
838
|
+
) ?? [],
|
|
839
|
+
).toHaveLength(0);
|
|
840
|
+
|
|
841
|
+
const backButton = tree?.root.find(
|
|
842
|
+
(node) => node.props["data-testid"] === "character-customize-toggle",
|
|
843
|
+
);
|
|
844
|
+
|
|
845
|
+
await act(async () => {
|
|
846
|
+
backButton?.props.onClick();
|
|
847
|
+
});
|
|
848
|
+
|
|
849
|
+
expect(
|
|
850
|
+
tree?.root.findAll(
|
|
851
|
+
(node) => node.props["data-testid"] === "character-roster-grid",
|
|
852
|
+
) ?? [],
|
|
853
|
+
).toHaveLength(1);
|
|
854
|
+
});
|
|
855
|
+
|
|
856
|
+
it("uses the selected character defaults when switching characters with custom off", async () => {
|
|
857
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
858
|
+
await act(async () => {
|
|
859
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
860
|
+
});
|
|
861
|
+
|
|
862
|
+
const sakuyaCard = tree?.root.find(
|
|
863
|
+
(node) => node.props["data-testid"] === "character-preset-Noted.",
|
|
864
|
+
);
|
|
865
|
+
|
|
866
|
+
await act(async () => {
|
|
867
|
+
sakuyaCard?.props.onClick();
|
|
868
|
+
});
|
|
869
|
+
|
|
870
|
+
expect(state.characterDraft?.name).toBe("Sakuya");
|
|
871
|
+
expect(state.characterDraft?.bio).toBe("Sakuya is precise");
|
|
872
|
+
expect(state.characterDraft?.system).toBe(
|
|
873
|
+
"You are Sakuya, exact and calm.",
|
|
874
|
+
);
|
|
875
|
+
expect(state.selectedVrmIndex).toBe(4);
|
|
876
|
+
});
|
|
877
|
+
|
|
878
|
+
it("preserves deep custom character settings on load while staying in roster mode", async () => {
|
|
879
|
+
state.characterData = {
|
|
880
|
+
name: "Reimu",
|
|
881
|
+
username: "Reimu",
|
|
882
|
+
bio: ["Custom bio line"],
|
|
883
|
+
system: "Custom Reimu system",
|
|
884
|
+
adjectives: ["friendly", "helpful", "wildcard"],
|
|
885
|
+
style: {
|
|
886
|
+
all: ["Custom all rule"],
|
|
887
|
+
chat: ["Custom chat rule"],
|
|
888
|
+
post: ["Custom post rule"],
|
|
889
|
+
},
|
|
890
|
+
messageExamples: [
|
|
891
|
+
{
|
|
892
|
+
examples: [
|
|
893
|
+
{ name: "{{user1}}", content: { text: "hey?" } },
|
|
894
|
+
{ name: "Reimu", content: { text: "custom answer" } },
|
|
895
|
+
],
|
|
896
|
+
},
|
|
897
|
+
],
|
|
898
|
+
postExamples: ["Custom post"],
|
|
899
|
+
};
|
|
900
|
+
state.characterDraft = { ...state.characterData };
|
|
901
|
+
|
|
902
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
903
|
+
await act(async () => {
|
|
904
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
905
|
+
});
|
|
906
|
+
|
|
907
|
+
expect(
|
|
908
|
+
tree?.root.findAll(
|
|
909
|
+
(node) => node.props["data-testid"] === "character-customize-grid",
|
|
910
|
+
) ?? [],
|
|
911
|
+
).toHaveLength(0);
|
|
912
|
+
expect(
|
|
913
|
+
tree?.root.findAll(
|
|
914
|
+
(node) => node.props["data-testid"] === "character-roster-grid",
|
|
915
|
+
) ?? [],
|
|
916
|
+
).toHaveLength(1);
|
|
917
|
+
expect(state.characterDraft?.bio).toEqual(["Custom bio line"]);
|
|
918
|
+
expect(state.characterDraft?.system).toBe("Custom Reimu system");
|
|
919
|
+
});
|
|
920
|
+
|
|
921
|
+
it("renders save button", async () => {
|
|
922
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
923
|
+
|
|
924
|
+
await act(async () => {
|
|
925
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
926
|
+
});
|
|
927
|
+
|
|
928
|
+
const saveButtons = tree?.root.findAll(
|
|
929
|
+
(node) =>
|
|
930
|
+
node.type === "button" &&
|
|
931
|
+
node.children.some(
|
|
932
|
+
(c) =>
|
|
933
|
+
typeof c === "string" &&
|
|
934
|
+
(c.toLowerCase().includes("save") ||
|
|
935
|
+
c.toLowerCase().includes("update")),
|
|
936
|
+
),
|
|
937
|
+
);
|
|
938
|
+
expect(saveButtons.length).toBeGreaterThanOrEqual(0);
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
it("saves the full character payload, voice config, and avatar selection", async () => {
|
|
942
|
+
mockUseApp.mockReset();
|
|
943
|
+
mockUseApp.mockImplementation(() => ({
|
|
944
|
+
uiLanguage: "en",
|
|
945
|
+
t: (k: string) => k,
|
|
946
|
+
...state,
|
|
947
|
+
setTab: vi.fn((tab: CharacterState["tab"]) => {
|
|
948
|
+
state.tab = tab;
|
|
949
|
+
}),
|
|
950
|
+
loadCharacter: vi.fn(),
|
|
951
|
+
loadRegistryStatus: vi.fn(),
|
|
952
|
+
loadDropStatus: vi.fn(),
|
|
953
|
+
handleSaveCharacter: async () => {
|
|
954
|
+
_saveCharacterCalled = true;
|
|
955
|
+
const characterDraft = state.characterDraft;
|
|
956
|
+
if (!characterDraft) {
|
|
957
|
+
throw new Error("Character draft is required before saving");
|
|
958
|
+
}
|
|
959
|
+
const prepared = prepareCharacterDraftForSave(characterDraft);
|
|
960
|
+
const { agentName } = await client.updateCharacter(
|
|
961
|
+
prepared as unknown as CharacterData,
|
|
962
|
+
);
|
|
963
|
+
await client.updateConfig({
|
|
964
|
+
ui: { avatarIndex: state.selectedVrmIndex },
|
|
965
|
+
});
|
|
966
|
+
state.characterSaving = false;
|
|
967
|
+
state.characterDirty = false;
|
|
968
|
+
state.characterSaveSuccess = "Character saved successfully.";
|
|
969
|
+
if (agentName) {
|
|
970
|
+
const fallbackCharacterData =
|
|
971
|
+
state.characterData ?? createCharacterUIState().characterData;
|
|
972
|
+
if (!fallbackCharacterData) {
|
|
973
|
+
throw new Error("Character data is required after saving");
|
|
974
|
+
}
|
|
975
|
+
state.characterData = {
|
|
976
|
+
...fallbackCharacterData,
|
|
977
|
+
...(prepared as CharacterData),
|
|
978
|
+
name: agentName,
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
},
|
|
982
|
+
handleCharacterFieldInput: (field: string, value: unknown) => {
|
|
983
|
+
if (state.characterDraft) {
|
|
984
|
+
(state.characterDraft as Record<string, unknown>)[field] = value;
|
|
985
|
+
state.characterDirty = true;
|
|
986
|
+
}
|
|
987
|
+
},
|
|
988
|
+
handleCharacterArrayInput: vi.fn(),
|
|
989
|
+
handleCharacterStyleInput: vi.fn(),
|
|
990
|
+
setState: vi.fn((key: string, value: unknown) => {
|
|
991
|
+
(state as Record<string, unknown>)[key] = value;
|
|
992
|
+
}),
|
|
993
|
+
}));
|
|
994
|
+
|
|
995
|
+
vi.mocked(client.updateCharacter).mockResolvedValue({
|
|
996
|
+
ok: true,
|
|
997
|
+
character: {} as CharacterData,
|
|
998
|
+
agentName: "Custom Sakuya",
|
|
999
|
+
});
|
|
1000
|
+
|
|
1001
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
1002
|
+
|
|
1003
|
+
await act(async () => {
|
|
1004
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
1005
|
+
});
|
|
1006
|
+
|
|
1007
|
+
state.characterDraft = {
|
|
1008
|
+
name: "Custom Sakuya",
|
|
1009
|
+
bio: " First line \n\n Second line ",
|
|
1010
|
+
system: "Be exact.",
|
|
1011
|
+
adjectives: ["precise", "calm"],
|
|
1012
|
+
style: {
|
|
1013
|
+
all: ["Be exact"],
|
|
1014
|
+
chat: ["Stay calm"],
|
|
1015
|
+
post: ["Be clear"],
|
|
1016
|
+
},
|
|
1017
|
+
messageExamples: [
|
|
1018
|
+
{
|
|
1019
|
+
examples: [
|
|
1020
|
+
{ name: "{{user1}}", content: { text: "status?" } },
|
|
1021
|
+
{ name: "Custom Sakuya", content: { text: "On track." } },
|
|
1022
|
+
],
|
|
1023
|
+
},
|
|
1024
|
+
],
|
|
1025
|
+
postExamples: ["Mission remains on schedule."],
|
|
1026
|
+
};
|
|
1027
|
+
state.selectedVrmIndex = 4;
|
|
1028
|
+
|
|
1029
|
+
const saveButton = tree?.root.find(
|
|
1030
|
+
(node) =>
|
|
1031
|
+
node.type === "button" &&
|
|
1032
|
+
node.children.some(
|
|
1033
|
+
(child) => typeof child === "string" && child === "Save Character",
|
|
1034
|
+
),
|
|
1035
|
+
);
|
|
1036
|
+
|
|
1037
|
+
await act(async () => {
|
|
1038
|
+
saveButton?.props.onClick();
|
|
1039
|
+
});
|
|
1040
|
+
|
|
1041
|
+
expect(_saveCharacterCalled).toBe(true);
|
|
1042
|
+
expect(client.updateCharacter).toHaveBeenCalledWith({
|
|
1043
|
+
name: "Custom Sakuya",
|
|
1044
|
+
username: "Custom Sakuya",
|
|
1045
|
+
bio: ["First line", "Second line"],
|
|
1046
|
+
system: "Be exact.",
|
|
1047
|
+
adjectives: ["precise", "calm"],
|
|
1048
|
+
style: {
|
|
1049
|
+
all: ["Be exact"],
|
|
1050
|
+
chat: ["Stay calm"],
|
|
1051
|
+
post: ["Be clear"],
|
|
1052
|
+
},
|
|
1053
|
+
messageExamples: [
|
|
1054
|
+
{
|
|
1055
|
+
examples: [
|
|
1056
|
+
{ name: "{{user1}}", content: { text: "status?" } },
|
|
1057
|
+
{ name: "Custom Sakuya", content: { text: "On track." } },
|
|
1058
|
+
],
|
|
1059
|
+
},
|
|
1060
|
+
],
|
|
1061
|
+
postExamples: ["Mission remains on schedule."],
|
|
1062
|
+
});
|
|
1063
|
+
expect(client.updateConfig).toHaveBeenNthCalledWith(1, {
|
|
1064
|
+
messages: {
|
|
1065
|
+
tts: {
|
|
1066
|
+
provider: "elevenlabs",
|
|
1067
|
+
elevenlabs: {
|
|
1068
|
+
voiceId: "EXAVITQu4vr4xnSDxMaL",
|
|
1069
|
+
modelId: "eleven_flash_v2_5",
|
|
1070
|
+
},
|
|
1071
|
+
},
|
|
1072
|
+
},
|
|
1073
|
+
});
|
|
1074
|
+
expect(client.updateConfig).toHaveBeenNthCalledWith(2, {
|
|
1075
|
+
ui: { avatarIndex: 4 },
|
|
1076
|
+
});
|
|
1077
|
+
});
|
|
1078
|
+
|
|
1079
|
+
it("shows loading state when characterLoading is true", async () => {
|
|
1080
|
+
state.characterLoading = true;
|
|
1081
|
+
state.characterData = null;
|
|
1082
|
+
|
|
1083
|
+
let tree: TestRenderer.ReactTestRenderer | null = null;
|
|
1084
|
+
|
|
1085
|
+
await act(async () => {
|
|
1086
|
+
tree = TestRenderer.create(React.createElement(CharacterView));
|
|
1087
|
+
});
|
|
1088
|
+
|
|
1089
|
+
// Should show some loading indicator or empty state
|
|
1090
|
+
expect(tree).not.toBeNull();
|
|
1091
|
+
});
|
|
1092
|
+
});
|
|
1093
|
+
|
|
1094
|
+
// ---------------------------------------------------------------------------
|
|
1095
|
+
// Part 3: Integration Tests - Character Edit Flow
|
|
1096
|
+
// ---------------------------------------------------------------------------
|
|
1097
|
+
|
|
1098
|
+
describe("Character Edit Integration", () => {
|
|
1099
|
+
let state: CharacterState;
|
|
1100
|
+
|
|
1101
|
+
beforeEach(() => {
|
|
1102
|
+
state = createCharacterUIState();
|
|
1103
|
+
|
|
1104
|
+
mockUseApp.mockReset();
|
|
1105
|
+
mockUseApp.mockImplementation(() => ({
|
|
1106
|
+
uiLanguage: "en",
|
|
1107
|
+
t: (k: string) => k,
|
|
1108
|
+
...state,
|
|
1109
|
+
loadCharacter: vi.fn(),
|
|
1110
|
+
saveCharacter: vi.fn().mockImplementation(async () => {
|
|
1111
|
+
state.characterSaving = false;
|
|
1112
|
+
state.characterDirty = false;
|
|
1113
|
+
}),
|
|
1114
|
+
setCharacterField: (field: string, value: unknown) => {
|
|
1115
|
+
if (state.characterData) {
|
|
1116
|
+
(state.characterData as Record<string, unknown>)[field] = value;
|
|
1117
|
+
state.characterDirty = true;
|
|
1118
|
+
}
|
|
1119
|
+
},
|
|
1120
|
+
}));
|
|
1121
|
+
});
|
|
1122
|
+
|
|
1123
|
+
it("editing name marks character as dirty", async () => {
|
|
1124
|
+
expect(state.characterDirty).toBe(false);
|
|
1125
|
+
|
|
1126
|
+
const mockSetField = mockUseApp().setCharacterField;
|
|
1127
|
+
mockSetField("name", "NewName");
|
|
1128
|
+
|
|
1129
|
+
expect(state.characterDirty).toBe(true);
|
|
1130
|
+
expect(state.characterData?.name).toBe("NewName");
|
|
1131
|
+
});
|
|
1132
|
+
|
|
1133
|
+
it("editing bio marks character as dirty", async () => {
|
|
1134
|
+
const mockSetField = mockUseApp().setCharacterField;
|
|
1135
|
+
mockSetField("bio", ["New bio line"]);
|
|
1136
|
+
|
|
1137
|
+
expect(state.characterDirty).toBe(true);
|
|
1138
|
+
expect(state.characterData?.bio).toEqual(["New bio line"]);
|
|
1139
|
+
});
|
|
1140
|
+
|
|
1141
|
+
it("editing system prompt marks character as dirty", async () => {
|
|
1142
|
+
const mockSetField = mockUseApp().setCharacterField;
|
|
1143
|
+
mockSetField("system", "New system prompt");
|
|
1144
|
+
|
|
1145
|
+
expect(state.characterDirty).toBe(true);
|
|
1146
|
+
expect(state.characterData?.system).toBe("New system prompt");
|
|
1147
|
+
});
|
|
1148
|
+
|
|
1149
|
+
it("adding adjective updates state", async () => {
|
|
1150
|
+
const mockSetField = mockUseApp().setCharacterField;
|
|
1151
|
+
const newAdj = [...(state.characterData?.adjectives || []), "creative"];
|
|
1152
|
+
mockSetField("adjectives", newAdj);
|
|
1153
|
+
|
|
1154
|
+
expect(state.characterData?.adjectives).toContain("creative");
|
|
1155
|
+
});
|
|
1156
|
+
|
|
1157
|
+
it("updating style rules works for all categories", async () => {
|
|
1158
|
+
const mockSetField = mockUseApp().setCharacterField;
|
|
1159
|
+
const newStyle = {
|
|
1160
|
+
all: ["New all rule"],
|
|
1161
|
+
chat: ["New chat rule"],
|
|
1162
|
+
post: ["New post rule"],
|
|
1163
|
+
};
|
|
1164
|
+
mockSetField("style", newStyle);
|
|
1165
|
+
|
|
1166
|
+
expect(state.characterData?.style).toEqual(newStyle);
|
|
1167
|
+
});
|
|
1168
|
+
});
|