@elizaos/app-core 2.0.0-alpha.10

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.
Files changed (399) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +90 -0
  3. package/src/App.tsx +472 -0
  4. package/src/actions/character.test.ts +139 -0
  5. package/src/actions/character.ts +152 -0
  6. package/src/actions/chat-helpers.ts +100 -0
  7. package/src/actions/cloud.ts +59 -0
  8. package/src/actions/index.ts +12 -0
  9. package/src/actions/lifecycle.ts +175 -0
  10. package/src/actions/onboarding.ts +46 -0
  11. package/src/actions/triggers.ts +190 -0
  12. package/src/ambient.d.ts +16 -0
  13. package/src/api/client.ts +5516 -0
  14. package/src/api/index.ts +1 -0
  15. package/src/autonomy/index.ts +477 -0
  16. package/src/bridge/capacitor-bridge.ts +295 -0
  17. package/src/bridge/electrobun-rpc.ts +58 -0
  18. package/src/bridge/electrobun-runtime.ts +28 -0
  19. package/src/bridge/index.ts +5 -0
  20. package/src/bridge/native-plugins.ts +134 -0
  21. package/src/bridge/plugin-bridge.ts +352 -0
  22. package/src/bridge/storage-bridge.ts +162 -0
  23. package/src/chat/index.ts +250 -0
  24. package/src/coding/index.ts +43 -0
  25. package/src/components/AdvancedPageView.tsx +362 -0
  26. package/src/components/AgentActivityBox.tsx +49 -0
  27. package/src/components/ApiKeyConfig.tsx +224 -0
  28. package/src/components/AppsPageView.tsx +52 -0
  29. package/src/components/AppsView.tsx +293 -0
  30. package/src/components/AvatarLoader.tsx +86 -0
  31. package/src/components/AvatarSelector.tsx +223 -0
  32. package/src/components/BscTradePanel.tsx +549 -0
  33. package/src/components/BugReportModal.tsx +499 -0
  34. package/src/components/CharacterView.tsx +1645 -0
  35. package/src/components/ChatAvatar.test.ts +96 -0
  36. package/src/components/ChatAvatar.tsx +147 -0
  37. package/src/components/ChatComposer.tsx +330 -0
  38. package/src/components/ChatMessage.tsx +448 -0
  39. package/src/components/ChatModalView.test.tsx +118 -0
  40. package/src/components/ChatModalView.tsx +125 -0
  41. package/src/components/ChatView.tsx +992 -0
  42. package/src/components/CloudSourceControls.tsx +80 -0
  43. package/src/components/CodingAgentSettingsSection.tsx +536 -0
  44. package/src/components/CommandPalette.tsx +284 -0
  45. package/src/components/CompanionSceneHost.tsx +497 -0
  46. package/src/components/CompanionShell.tsx +31 -0
  47. package/src/components/CompanionView.tsx +109 -0
  48. package/src/components/ConfigPageView.tsx +758 -0
  49. package/src/components/ConfigSaveFooter.tsx +41 -0
  50. package/src/components/ConfirmModal.tsx +379 -0
  51. package/src/components/ConnectionFailedBanner.tsx +91 -0
  52. package/src/components/ConnectorsPageView.tsx +13 -0
  53. package/src/components/ConversationsSidebar.tsx +279 -0
  54. package/src/components/CustomActionEditor.tsx +1125 -0
  55. package/src/components/CustomActionsPanel.tsx +288 -0
  56. package/src/components/CustomActionsView.tsx +322 -0
  57. package/src/components/DatabasePageView.tsx +55 -0
  58. package/src/components/DatabaseView.tsx +814 -0
  59. package/src/components/ElizaCloudDashboard.tsx +1696 -0
  60. package/src/components/EmotePicker.tsx +529 -0
  61. package/src/components/ErrorBoundary.tsx +76 -0
  62. package/src/components/FineTuningView.tsx +1077 -0
  63. package/src/components/GameView.tsx +552 -0
  64. package/src/components/GameViewOverlay.tsx +133 -0
  65. package/src/components/GlobalEmoteOverlay.tsx +155 -0
  66. package/src/components/Header.test.tsx +413 -0
  67. package/src/components/Header.tsx +403 -0
  68. package/src/components/HeartbeatsView.tsx +1003 -0
  69. package/src/components/InventoryView.tsx +385 -0
  70. package/src/components/KnowledgeView.tsx +1128 -0
  71. package/src/components/LanguageDropdown.tsx +188 -0
  72. package/src/components/LifoMonitorPanel.tsx +196 -0
  73. package/src/components/LifoSandboxView.tsx +499 -0
  74. package/src/components/LoadingScreen.tsx +77 -0
  75. package/src/components/LogsPageView.tsx +17 -0
  76. package/src/components/LogsView.tsx +239 -0
  77. package/src/components/MediaGalleryView.tsx +433 -0
  78. package/src/components/MediaSettingsSection.tsx +893 -0
  79. package/src/components/MessageContent.tsx +815 -0
  80. package/src/components/OnboardingWizard.test.tsx +107 -0
  81. package/src/components/OnboardingWizard.tsx +189 -0
  82. package/src/components/PairingView.tsx +110 -0
  83. package/src/components/PermissionsSection.tsx +1186 -0
  84. package/src/components/PluginsPageView.tsx +9 -0
  85. package/src/components/PluginsView.tsx +3157 -0
  86. package/src/components/ProviderSwitcher.tsx +908 -0
  87. package/src/components/RestartBanner.tsx +76 -0
  88. package/src/components/RuntimeView.tsx +460 -0
  89. package/src/components/SaveCommandModal.tsx +211 -0
  90. package/src/components/SecretsView.tsx +569 -0
  91. package/src/components/SettingsView.tsx +825 -0
  92. package/src/components/ShellOverlays.tsx +41 -0
  93. package/src/components/ShortcutsOverlay.tsx +155 -0
  94. package/src/components/SkillsView.tsx +1435 -0
  95. package/src/components/StartupFailureView.tsx +63 -0
  96. package/src/components/StreamView.tsx +483 -0
  97. package/src/components/StripeEmbeddedCheckout.tsx +155 -0
  98. package/src/components/SubscriptionStatus.tsx +640 -0
  99. package/src/components/SystemWarningBanner.tsx +71 -0
  100. package/src/components/ThemeToggle.tsx +100 -0
  101. package/src/components/TrajectoriesView.tsx +526 -0
  102. package/src/components/TrajectoryDetailView.tsx +426 -0
  103. package/src/components/TriggersView.tsx +1 -0
  104. package/src/components/VectorBrowserView.tsx +1633 -0
  105. package/src/components/VoiceConfigView.tsx +675 -0
  106. package/src/components/VrmStage.test.ts +219 -0
  107. package/src/components/VrmStage.tsx +432 -0
  108. package/src/components/WhatsAppQrOverlay.tsx +230 -0
  109. package/src/components/__tests__/chainConfig.test.ts +220 -0
  110. package/src/components/apps/AppDetailPane.tsx +242 -0
  111. package/src/components/apps/AppsCatalogGrid.tsx +137 -0
  112. package/src/components/apps/extensions/HyperscapeAppDetailPanel.tsx +577 -0
  113. package/src/components/apps/extensions/registry.ts +16 -0
  114. package/src/components/apps/extensions/types.ts +9 -0
  115. package/src/components/apps/helpers.ts +44 -0
  116. package/src/components/avatar/VrmAnimationLoader.test.ts +164 -0
  117. package/src/components/avatar/VrmAnimationLoader.ts +151 -0
  118. package/src/components/avatar/VrmBlinkController.ts +118 -0
  119. package/src/components/avatar/VrmCameraManager.ts +407 -0
  120. package/src/components/avatar/VrmEngine.ts +2678 -0
  121. package/src/components/avatar/VrmFootShadow.ts +96 -0
  122. package/src/components/avatar/VrmViewer.tsx +421 -0
  123. package/src/components/avatar/__tests__/VrmCameraManager.test.ts +168 -0
  124. package/src/components/avatar/__tests__/VrmEngine.test.ts +1574 -0
  125. package/src/components/avatar/mixamoVRMRigMap.ts +62 -0
  126. package/src/components/avatar/retargetMixamoFbxToVrm.ts +144 -0
  127. package/src/components/avatar/retargetMixamoGltfToVrm.ts +119 -0
  128. package/src/components/chainConfig.ts +380 -0
  129. package/src/components/companion/CompanionHeader.tsx +47 -0
  130. package/src/components/companion/CompanionSceneHost.tsx +1 -0
  131. package/src/components/companion/VrmStage.tsx +2 -0
  132. package/src/components/companion/__tests__/walletUtils.test.ts +742 -0
  133. package/src/components/companion/walletUtils.ts +290 -0
  134. package/src/components/companion-shell-styles.test.ts +142 -0
  135. package/src/components/companion-shell-styles.ts +270 -0
  136. package/src/components/confirm-delete-control.tsx +69 -0
  137. package/src/components/conversations/ConversationListItem.tsx +185 -0
  138. package/src/components/conversations/conversation-utils.ts +151 -0
  139. package/src/components/format.ts +131 -0
  140. package/src/components/index.ts +94 -0
  141. package/src/components/inventory/CopyableAddress.tsx +41 -0
  142. package/src/components/inventory/InventoryToolbar.tsx +142 -0
  143. package/src/components/inventory/NftGrid.tsx +99 -0
  144. package/src/components/inventory/TokenLogo.tsx +71 -0
  145. package/src/components/inventory/TokensTable.tsx +216 -0
  146. package/src/components/inventory/constants.ts +170 -0
  147. package/src/components/inventory/index.ts +29 -0
  148. package/src/components/inventory/media-url.test.ts +38 -0
  149. package/src/components/inventory/media-url.ts +36 -0
  150. package/src/components/inventory/useInventoryData.ts +460 -0
  151. package/src/components/knowledge-upload-image.ts +215 -0
  152. package/src/components/labels.ts +46 -0
  153. package/src/components/onboarding/ActivateStep.tsx +30 -0
  154. package/src/components/onboarding/ConnectionStep.tsx +1530 -0
  155. package/src/components/onboarding/IdentityStep.tsx +147 -0
  156. package/src/components/onboarding/OnboardingPanel.tsx +39 -0
  157. package/src/components/onboarding/OnboardingStepNav.tsx +31 -0
  158. package/src/components/onboarding/PermissionsStep.tsx +20 -0
  159. package/src/components/onboarding/RpcStep.tsx +402 -0
  160. package/src/components/onboarding/WakeUpStep.tsx +184 -0
  161. package/src/components/permissions/PermissionIcon.tsx +25 -0
  162. package/src/components/permissions/StreamingPermissions.tsx +413 -0
  163. package/src/components/plugins/showcase-data.ts +481 -0
  164. package/src/components/shared/ShellHeaderControls.tsx +193 -0
  165. package/src/components/shared-companion-scene-context.ts +15 -0
  166. package/src/components/skeletons.tsx +88 -0
  167. package/src/components/stream/ActivityFeed.tsx +113 -0
  168. package/src/components/stream/AvatarPip.tsx +10 -0
  169. package/src/components/stream/ChatContent.tsx +126 -0
  170. package/src/components/stream/ChatTicker.tsx +55 -0
  171. package/src/components/stream/IdleContent.tsx +73 -0
  172. package/src/components/stream/StatusBar.tsx +469 -0
  173. package/src/components/stream/StreamSettings.tsx +506 -0
  174. package/src/components/stream/StreamTerminal.tsx +94 -0
  175. package/src/components/stream/StreamVoiceConfig.tsx +160 -0
  176. package/src/components/stream/helpers.ts +134 -0
  177. package/src/components/stream/overlays/OverlayLayer.tsx +75 -0
  178. package/src/components/stream/overlays/built-in/ActionTickerWidget.tsx +64 -0
  179. package/src/components/stream/overlays/built-in/AlertPopupWidget.tsx +87 -0
  180. package/src/components/stream/overlays/built-in/BrandingWidget.tsx +51 -0
  181. package/src/components/stream/overlays/built-in/CustomHtmlWidget.tsx +105 -0
  182. package/src/components/stream/overlays/built-in/PeonGlassWidget.tsx +265 -0
  183. package/src/components/stream/overlays/built-in/PeonHudWidget.tsx +247 -0
  184. package/src/components/stream/overlays/built-in/PeonSakuraWidget.tsx +278 -0
  185. package/src/components/stream/overlays/built-in/ThoughtBubbleWidget.tsx +77 -0
  186. package/src/components/stream/overlays/built-in/ViewerCountWidget.tsx +46 -0
  187. package/src/components/stream/overlays/built-in/index.ts +13 -0
  188. package/src/components/stream/overlays/registry.ts +22 -0
  189. package/src/components/stream/overlays/types.ts +90 -0
  190. package/src/components/stream/overlays/useOverlayLayout.ts +218 -0
  191. package/src/components/trajectory-format.ts +50 -0
  192. package/src/components/ui-badges.tsx +109 -0
  193. package/src/components/ui-switch.tsx +57 -0
  194. package/src/components/vector-browser-three.ts +27 -0
  195. package/src/config/config-catalog.ts +1092 -0
  196. package/src/config/config-field.tsx +1901 -0
  197. package/src/config/config-renderer.tsx +730 -0
  198. package/src/config/index.ts +11 -0
  199. package/src/config/ui-renderer.tsx +1751 -0
  200. package/src/config/ui-spec.ts +256 -0
  201. package/src/events/index.ts +89 -0
  202. package/src/hooks/index.ts +13 -0
  203. package/src/hooks/useBugReport.tsx +43 -0
  204. package/src/hooks/useCanvasWindow.ts +372 -0
  205. package/src/hooks/useChatAvatarVoice.ts +111 -0
  206. package/src/hooks/useContextMenu.ts +127 -0
  207. package/src/hooks/useKeyboardShortcuts.ts +86 -0
  208. package/src/hooks/useLifoSync.ts +143 -0
  209. package/src/hooks/useMemoryMonitor.ts +334 -0
  210. package/src/hooks/useRenderGuard.ts +43 -0
  211. package/src/hooks/useRetakeCapture.ts +67 -0
  212. package/src/hooks/useStreamPopoutNavigation.ts +27 -0
  213. package/src/hooks/useTimeout.ts +37 -0
  214. package/src/hooks/useVoiceChat.ts +1441 -0
  215. package/src/hooks/useWhatsAppPairing.ts +123 -0
  216. package/src/i18n/index.ts +76 -0
  217. package/src/i18n/locales/en.json +1194 -0
  218. package/src/i18n/locales/es.json +1194 -0
  219. package/src/i18n/locales/ko.json +1194 -0
  220. package/src/i18n/locales/pt.json +1194 -0
  221. package/src/i18n/locales/zh-CN.json +1194 -0
  222. package/src/i18n/messages.ts +21 -0
  223. package/src/index.ts +6 -0
  224. package/src/navigation/index.ts +282 -0
  225. package/src/navigation.test.ts +189 -0
  226. package/src/onboarding-config.test.ts +104 -0
  227. package/src/onboarding-config.ts +114 -0
  228. package/src/platform/browser-launch.test.ts +94 -0
  229. package/src/platform/browser-launch.ts +149 -0
  230. package/src/platform/index.ts +58 -0
  231. package/src/platform/init.ts +236 -0
  232. package/src/platform/lifo.ts +215 -0
  233. package/src/providers/index.ts +99 -0
  234. package/src/state/AppContext.tsx +5846 -0
  235. package/src/state/index.ts +6 -0
  236. package/src/state/internal.ts +86 -0
  237. package/src/state/onboarding-resume.test.ts +135 -0
  238. package/src/state/onboarding-resume.ts +263 -0
  239. package/src/state/parsers.test.ts +124 -0
  240. package/src/state/parsers.ts +308 -0
  241. package/src/state/persistence.ts +321 -0
  242. package/src/state/shell-routing.ts +32 -0
  243. package/src/state/types.ts +701 -0
  244. package/src/state/ui-preferences.ts +3 -0
  245. package/src/state/useApp.ts +23 -0
  246. package/src/state/vrm.ts +76 -0
  247. package/src/stories/AppMockProvider.tsx +32 -0
  248. package/src/stories/ChatEmptyState.stories.tsx +27 -0
  249. package/src/stories/ChatMessage.stories.tsx +115 -0
  250. package/src/stories/CompanionHeader.stories.tsx +74 -0
  251. package/src/stories/CompanionView.stories.tsx +33 -0
  252. package/src/stories/ConversationListItem.stories.tsx +102 -0
  253. package/src/stories/TypingIndicator.stories.tsx +28 -0
  254. package/src/styles/anime.css +6324 -0
  255. package/src/styles/base.css +196 -0
  256. package/src/styles/onboarding-game.css +738 -0
  257. package/src/styles/styles.css +2087 -0
  258. package/src/styles/xterm.css +241 -0
  259. package/src/types/index.ts +715 -0
  260. package/src/types/react-test-renderer.d.ts +45 -0
  261. package/src/utils/asset-url.ts +110 -0
  262. package/src/utils/assistant-text.ts +172 -0
  263. package/src/utils/clipboard.ts +41 -0
  264. package/src/utils/desktop-dialogs.ts +80 -0
  265. package/src/utils/index.ts +6 -0
  266. package/src/utils/number-parsing.ts +125 -0
  267. package/src/utils/openExternalUrl.ts +20 -0
  268. package/src/utils/spoken-text.ts +65 -0
  269. package/src/utils/streaming-text.ts +120 -0
  270. package/src/voice/index.ts +1 -0
  271. package/src/voice/types.ts +197 -0
  272. package/src/wallet-rpc.ts +176 -0
  273. package/test/app/AppContext.pty-sessions.test.tsx +143 -0
  274. package/test/app/MessageContent.test.tsx +326 -0
  275. package/test/app/PermissionsOnboarding.test.tsx +356 -0
  276. package/test/app/PermissionsSection.test.tsx +573 -0
  277. package/test/app/advanced-trajectory-fine-tuning.e2e.test.ts +393 -0
  278. package/test/app/agent-activity-box.test.tsx +132 -0
  279. package/test/app/agent-transfer-lock.test.ts +274 -0
  280. package/test/app/api-client-electron-fallback.test.ts +139 -0
  281. package/test/app/api-client-timeout.test.ts +75 -0
  282. package/test/app/api-client-ws.test.ts +98 -0
  283. package/test/app/api-client.ws-max-reconnect.test.ts +139 -0
  284. package/test/app/api-client.ws-reconnect.test.ts +157 -0
  285. package/test/app/app-context-autonomy-events.test.ts +478 -0
  286. package/test/app/apps-page-view.test.ts +114 -0
  287. package/test/app/apps-view.test.ts +769 -0
  288. package/test/app/autonomous-workflows.e2e.test.ts +765 -0
  289. package/test/app/autonomy-events.test.ts +150 -0
  290. package/test/app/avatar-selector.test.tsx +52 -0
  291. package/test/app/bsc-trade-panel.test.tsx +134 -0
  292. package/test/app/bug-report-modal.test.tsx +353 -0
  293. package/test/app/character-customization.e2e.test.ts +1199 -0
  294. package/test/app/chat-advanced-features.e2e.test.ts +706 -0
  295. package/test/app/chat-composer.test.tsx +181 -0
  296. package/test/app/chat-language-header.test.ts +64 -0
  297. package/test/app/chat-message.test.tsx +222 -0
  298. package/test/app/chat-modal-view.test.tsx +191 -0
  299. package/test/app/chat-routine-filter.test.ts +96 -0
  300. package/test/app/chat-send-lock.test.ts +1465 -0
  301. package/test/app/chat-stream-api-client.test.tsx +390 -0
  302. package/test/app/chat-view-game-modal.test.tsx +661 -0
  303. package/test/app/chat-view.test.tsx +877 -0
  304. package/test/app/cloud-api.e2e.test.ts +258 -0
  305. package/test/app/cloud-login-flow.e2e.test.ts +494 -0
  306. package/test/app/cloud-login-lock.test.ts +411 -0
  307. package/test/app/command-palette.test.tsx +184 -0
  308. package/test/app/command-registry.test.ts +75 -0
  309. package/test/app/companion-greeting-wave.test.tsx +425 -0
  310. package/test/app/companion-stale-conversation.test.tsx +447 -0
  311. package/test/app/companion-view.test.tsx +686 -0
  312. package/test/app/confirm-delete-control.test.ts +79 -0
  313. package/test/app/confirm-modal.test.tsx +219 -0
  314. package/test/app/connectors-ui.e2e.test.ts +508 -0
  315. package/test/app/conversations-sidebar-game-modal.test.tsx +260 -0
  316. package/test/app/conversations-sidebar.test.tsx +160 -0
  317. package/test/app/custom-actions-smoke.test.ts +387 -0
  318. package/test/app/custom-avatar-api-client.test.ts +207 -0
  319. package/test/app/desktop-utils.test.ts +145 -0
  320. package/test/app/electrobun-rpc-bridge.test.ts +83 -0
  321. package/test/app/events.test.ts +88 -0
  322. package/test/app/export-import-flows.e2e.test.ts +700 -0
  323. package/test/app/fine-tuning-view.test.ts +471 -0
  324. package/test/app/game-view-auth-session.test.tsx +186 -0
  325. package/test/app/game-view.test.ts +444 -0
  326. package/test/app/global-emote-overlay.test.tsx +106 -0
  327. package/test/app/header-status.test.tsx +149 -0
  328. package/test/app/i18n.test.ts +152 -0
  329. package/test/app/inventory-bsc-view.test.ts +940 -0
  330. package/test/app/knowledge-ui.e2e.test.ts +762 -0
  331. package/test/app/knowledge-upload-helpers.test.ts +124 -0
  332. package/test/app/lifecycle-lock.test.ts +267 -0
  333. package/test/app/lifo-popout-utils.test.ts +208 -0
  334. package/test/app/lifo-safe-endpoint.test.ts +34 -0
  335. package/test/app/loading-screen.test.tsx +45 -0
  336. package/test/app/memory-monitor.test.ts +332 -0
  337. package/test/app/navigation.test.tsx +22 -0
  338. package/test/app/onboarding-finish-lock.test.ts +663 -0
  339. package/test/app/onboarding-language.test.tsx +160 -0
  340. package/test/app/onboarding-steps.test.tsx +375 -0
  341. package/test/app/open-external-url.test.ts +65 -0
  342. package/test/app/pages-navigation-smoke.e2e.test.ts +633 -0
  343. package/test/app/pairing-lock.test.ts +260 -0
  344. package/test/app/pairing-view.test.tsx +74 -0
  345. package/test/app/permissions-section.test.ts +432 -0
  346. package/test/app/plugin-bridge.test.ts +109 -0
  347. package/test/app/plugins-ui.e2e.test.ts +605 -0
  348. package/test/app/plugins-view-game-modal.test.tsx +650 -0
  349. package/test/app/plugins-view-toggle-restart.test.ts +129 -0
  350. package/test/app/provider-dropdown-default.test.tsx +302 -0
  351. package/test/app/restart-banner.test.tsx +197 -0
  352. package/test/app/retake-capture.test.ts +84 -0
  353. package/test/app/sandbox-api-client.test.ts +108 -0
  354. package/test/app/save-command-modal.test.tsx +109 -0
  355. package/test/app/secrets-view.test.tsx +92 -0
  356. package/test/app/settings-control-styles.test.tsx +142 -0
  357. package/test/app/settings-reset.e2e.test.ts +726 -0
  358. package/test/app/settings-sections.e2e.test.ts +614 -0
  359. package/test/app/shared-format.test.ts +44 -0
  360. package/test/app/shared-switch.test.ts +69 -0
  361. package/test/app/shell-mode-switching.e2e.test.ts +829 -0
  362. package/test/app/shell-mode-tab-memory.test.tsx +58 -0
  363. package/test/app/shell-overlays.test.tsx +50 -0
  364. package/test/app/shortcuts-overlay.test.tsx +111 -0
  365. package/test/app/sse-interruption.test.ts +122 -0
  366. package/test/app/startup-asset-missing.e2e.test.ts +126 -0
  367. package/test/app/startup-backend-missing.e2e.test.ts +118 -0
  368. package/test/app/startup-chat.e2e.test.ts +305 -0
  369. package/test/app/startup-conversation-restore.test.tsx +344 -0
  370. package/test/app/startup-failure-view.test.tsx +103 -0
  371. package/test/app/startup-onboarding.e2e.test.ts +618 -0
  372. package/test/app/startup-timeout.test.tsx +80 -0
  373. package/test/app/startup-token-401.e2e.test.ts +103 -0
  374. package/test/app/stream-helpers.test.ts +46 -0
  375. package/test/app/stream-popout-navigation.test.tsx +41 -0
  376. package/test/app/stream-status-bar.test.tsx +89 -0
  377. package/test/app/theme-toggle.test.tsx +33 -0
  378. package/test/app/training-api-client.test.ts +128 -0
  379. package/test/app/trajectories-view.test.tsx +220 -0
  380. package/test/app/triggers-api-client.test.ts +77 -0
  381. package/test/app/triggers-navigation.test.ts +113 -0
  382. package/test/app/triggers-view.e2e.test.ts +674 -0
  383. package/test/app/update-channel-lock.test.ts +259 -0
  384. package/test/app/vector-browser.async-cleanup.test.tsx +367 -0
  385. package/test/app/vector-browser.e2e.test.ts +653 -0
  386. package/test/app/vrm-stage.test.tsx +351 -0
  387. package/test/app/vrm-viewer.test.tsx +298 -0
  388. package/test/app/wallet-api-save-lock.test.ts +298 -0
  389. package/test/app/wallet-hooks.test.ts +405 -0
  390. package/test/app/wallet-ui-flows.e2e.test.ts +556 -0
  391. package/test/avatar/asset-url.test.ts +90 -0
  392. package/test/avatar/avatar-selector.test.ts +173 -0
  393. package/test/avatar/mixamo-vrm-rig-map.test.ts +111 -0
  394. package/test/avatar/voice-chat-streaming-text.test.ts +96 -0
  395. package/test/avatar/voice-chat.test.ts +391 -0
  396. package/test/ui/command-palette-commands.test.ts +57 -0
  397. package/test/ui/ui-renderer.test.ts +39 -0
  398. package/tsconfig.build.json +19 -0
  399. package/tsconfig.json +20 -0
@@ -0,0 +1,506 @@
1
+ /**
2
+ * StreamSettings — in-stream settings panel.
3
+ *
4
+ * Panels:
5
+ * 1. Channel / destination picker
6
+ * 2. Overlay widget manager (enable/disable + per-widget config)
7
+ * 3. Stream source selector (stream-tab, game, custom-url)
8
+ */
9
+
10
+ import { useApp } from "@elizaos/app-core/state";
11
+ import { Button, Checkbox, Input, Switch } from "@elizaos/ui";
12
+ import { useState } from "react";
13
+ import type { StreamSourceType } from "./helpers";
14
+ import { isSupportedStreamUrl, STREAM_SOURCE_LABELS } from "./helpers";
15
+ import { getAllWidgets } from "./overlays/registry";
16
+ import type { WidgetConfigField, WidgetInstance } from "./overlays/types";
17
+ import type { UseOverlayLayout } from "./overlays/useOverlayLayout";
18
+
19
+ type Section = "channel" | "overlays" | "source";
20
+
21
+ interface StreamSettingsProps {
22
+ destinations: Array<{ id: string; name: string }>;
23
+ activeDestination: { id: string; name: string } | null;
24
+ onDestinationChange: (id: string) => void;
25
+ streamLive: boolean;
26
+ streamSource: { type: StreamSourceType; url?: string };
27
+ activeGameViewerUrl: string;
28
+ onSourceChange: (sourceType: StreamSourceType, customUrl?: string) => void;
29
+ overlayLayout: UseOverlayLayout;
30
+ onClose: () => void;
31
+ }
32
+
33
+ // ---------------------------------------------------------------------------
34
+ // Config field renderer
35
+ // ---------------------------------------------------------------------------
36
+
37
+ function ConfigField({
38
+ fieldKey,
39
+ field,
40
+ value,
41
+ onChange,
42
+ }: {
43
+ fieldKey: string;
44
+ field: WidgetConfigField;
45
+ value: unknown;
46
+ onChange: (key: string, value: unknown) => void;
47
+ }) {
48
+ switch (field.type) {
49
+ case "boolean":
50
+ return (
51
+ <label
52
+ key={fieldKey}
53
+ htmlFor={`config-${fieldKey}`}
54
+ className="flex items-center gap-2 text-[12px] text-txt cursor-pointer"
55
+ >
56
+ <Checkbox
57
+ id={`config-${fieldKey}`}
58
+ checked={Boolean(value)}
59
+ onCheckedChange={(checked) => onChange(fieldKey, !!checked)}
60
+ />
61
+ {field.label}
62
+ </label>
63
+ );
64
+ case "number":
65
+ return (
66
+ <label
67
+ key={fieldKey}
68
+ htmlFor={`config-${fieldKey}`}
69
+ className="flex flex-col gap-0.5"
70
+ >
71
+ <span className="text-[11px] text-muted">{field.label}</span>
72
+ <Input
73
+ id={`config-${fieldKey}`}
74
+ type="number"
75
+ min={field.min}
76
+ max={field.max}
77
+ value={
78
+ typeof value === "number" ? value : (field.default as number)
79
+ }
80
+ onChange={(e) => onChange(fieldKey, Number(e.target.value))}
81
+ className="h-8 bg-bg-muted border-border text-xs rounded px-2"
82
+ />
83
+ </label>
84
+ );
85
+ case "select":
86
+ return (
87
+ <label
88
+ key={fieldKey}
89
+ htmlFor={`config-${fieldKey}`}
90
+ className="flex flex-col gap-0.5"
91
+ >
92
+ <span className="text-[11px] text-muted">{field.label}</span>
93
+ <select
94
+ id={`config-${fieldKey}`}
95
+ value={typeof value === "string" ? value : String(field.default)}
96
+ onChange={(e) => onChange(fieldKey, e.target.value)}
97
+ className="bg-bg-muted border border-border text-txt text-[12px] rounded px-2 py-1 cursor-pointer"
98
+ >
99
+ {field.options?.map((opt) => (
100
+ <option key={opt.value} value={opt.value}>
101
+ {opt.label}
102
+ </option>
103
+ ))}
104
+ </select>
105
+ </label>
106
+ );
107
+ case "color":
108
+ return (
109
+ <label
110
+ key={fieldKey}
111
+ htmlFor={`config-${fieldKey}`}
112
+ className="flex items-center gap-2"
113
+ >
114
+ <span className="text-[11px] text-muted">{field.label}</span>
115
+ <input
116
+ id={`config-${fieldKey}`}
117
+ type="color"
118
+ value={typeof value === "string" ? value : String(field.default)}
119
+ onChange={(e) => onChange(fieldKey, e.target.value)}
120
+ className="w-8 h-6 rounded border border-border cursor-pointer bg-transparent"
121
+ />
122
+ </label>
123
+ );
124
+ default:
125
+ return (
126
+ <label
127
+ key={fieldKey}
128
+ htmlFor={`config-${fieldKey}`}
129
+ className="flex flex-col gap-0.5"
130
+ >
131
+ <span className="text-[11px] text-muted">{field.label}</span>
132
+ <Input
133
+ id={`config-${fieldKey}`}
134
+ type="text"
135
+ value={
136
+ typeof value === "string" ? value : String(field.default ?? "")
137
+ }
138
+ onChange={(e) => onChange(fieldKey, e.target.value)}
139
+ className="h-8 bg-bg-muted border-border text-xs rounded px-2"
140
+ />
141
+ </label>
142
+ );
143
+ }
144
+ }
145
+
146
+ // ---------------------------------------------------------------------------
147
+ // Widget row
148
+ // ---------------------------------------------------------------------------
149
+
150
+ function WidgetRow({
151
+ instance,
152
+ onToggle,
153
+ onUpdate,
154
+ }: {
155
+ instance: WidgetInstance;
156
+ onToggle: () => void;
157
+ onUpdate: (patch: Partial<Pick<WidgetInstance, "config">>) => void;
158
+ }) {
159
+ const { t } = useApp();
160
+ const [expanded, setExpanded] = useState(false);
161
+ const def = getAllWidgets().find((d) => d.type === instance.type);
162
+ const hasConfig = def && Object.keys(def.configSchema).length > 0;
163
+
164
+ return (
165
+ <div className="border border-border rounded-lg overflow-hidden">
166
+ <div className="flex items-center gap-2 px-3 py-2 bg-[rgba(255,255,255,0.03)]">
167
+ {/* Toggle */}
168
+ <Switch
169
+ checked={instance.enabled}
170
+ onCheckedChange={onToggle}
171
+ title={
172
+ instance.enabled
173
+ ? t("streamsettings.DisableWidget")
174
+ : t("streamsettings.EnableWidget")
175
+ }
176
+ />
177
+
178
+ <div className="flex-1 min-w-0">
179
+ <div className="text-[12px] font-medium text-txt truncate">
180
+ {def?.name ?? instance.type}
181
+ </div>
182
+ {def?.description && (
183
+ <div className="text-[10px] text-muted truncate">
184
+ {def.description}
185
+ </div>
186
+ )}
187
+ </div>
188
+
189
+ {hasConfig && (
190
+ <Button
191
+ variant="ghost"
192
+ size="sm"
193
+ onClick={() => setExpanded((x) => !x)}
194
+ className="text-muted hover:text-txt text-[10px] h-6 px-1.5 py-0 bg-bg-muted"
195
+ >
196
+ {expanded
197
+ ? t("streamsettings.ConfigExpanded")
198
+ : t("streamsettings.ConfigCollapsed")}
199
+ </Button>
200
+ )}
201
+ </div>
202
+
203
+ {expanded && hasConfig && def && (
204
+ <div className="px-3 py-2 border-t border-border flex flex-col gap-2">
205
+ {Object.entries(def.configSchema).map(([key, field]) => (
206
+ <ConfigField
207
+ key={key}
208
+ fieldKey={key}
209
+ field={field}
210
+ value={instance.config[key] ?? field.default}
211
+ onChange={(k, v) =>
212
+ onUpdate({ config: { ...instance.config, [k]: v } })
213
+ }
214
+ />
215
+ ))}
216
+ </div>
217
+ )}
218
+ </div>
219
+ );
220
+ }
221
+
222
+ // ---------------------------------------------------------------------------
223
+ // Main panel
224
+ // ---------------------------------------------------------------------------
225
+
226
+ export function StreamSettings({
227
+ destinations,
228
+ activeDestination,
229
+ onDestinationChange,
230
+ streamLive,
231
+ streamSource,
232
+ activeGameViewerUrl,
233
+ onSourceChange,
234
+ overlayLayout,
235
+ onClose,
236
+ }: StreamSettingsProps) {
237
+ const { t } = useApp();
238
+ const [section, setSection] = useState<Section>("channel");
239
+ const [customUrlInput, setCustomUrlInput] = useState(
240
+ streamSource.type === "custom-url" ? (streamSource.url ?? "") : "",
241
+ );
242
+ const trimmedCustomUrl = customUrlInput.trim();
243
+ const customUrlValid = isSupportedStreamUrl(trimmedCustomUrl);
244
+
245
+ const { layout, toggleWidget, updateWidget, resetLayout } = overlayLayout;
246
+
247
+ const navBtn = (id: Section, label: string) => (
248
+ <Button
249
+ variant={section === id ? "default" : "ghost"}
250
+ size="sm"
251
+ onClick={() => setSection(id)}
252
+ className={`px-3 py-1.5 text-[12px] font-medium rounded-lg transition-colors h-auto ${
253
+ section === id
254
+ ? "bg-accent/20 text-txt hover:bg-accent/30"
255
+ : "text-muted hover:text-txt hover:bg-bg-muted"
256
+ }`}
257
+ >
258
+ {label}
259
+ </Button>
260
+ );
261
+
262
+ return (
263
+ <div
264
+ className="absolute inset-0 z-50 flex items-end justify-center"
265
+ style={{ background: "rgba(0,0,0,0.6)", backdropFilter: "blur(4px)" }}
266
+ >
267
+ <div
268
+ className="w-full max-w-xl rounded-t-2xl border border-border overflow-hidden flex flex-col"
269
+ style={{ background: "rgba(14,18,28,0.97)", maxHeight: "80vh" }}
270
+ >
271
+ {/* Header */}
272
+ <div className="flex items-center justify-between px-4 py-3 border-b border-border flex-shrink-0">
273
+ <span className="text-[13px] font-semibold text-txt">
274
+ {t("streamsettings.StreamSettings")}
275
+ </span>
276
+ <Button
277
+ variant="ghost"
278
+ size="sm"
279
+ onClick={onClose}
280
+ className="text-muted hover:text-txt transition-colors text-lg leading-none p-1 h-auto"
281
+ >
282
+ ×
283
+ </Button>
284
+ </div>
285
+
286
+ {/* Nav */}
287
+ <div className="flex gap-1 px-4 py-2 border-b border-border flex-shrink-0">
288
+ {navBtn("channel", t("streamsettings.NavChannel"))}
289
+ {navBtn("overlays", t("streamsettings.NavOverlays"))}
290
+ {navBtn("source", t("streamsettings.NavSource"))}
291
+ </div>
292
+
293
+ {/* Content */}
294
+ <div className="overflow-y-auto flex-1 px-4 py-4">
295
+ {/* ── Channel / destination ─────────────────────────────── */}
296
+ {section === "channel" && (
297
+ <div className="flex flex-col gap-3">
298
+ <p className="text-[12px] text-muted">
299
+ {t("streamsettings.SelectWhereToBroa")}
300
+ </p>
301
+
302
+ {destinations.length === 0 ? (
303
+ <div className="text-[12px] text-muted border border-border rounded-lg p-4 text-center">
304
+ {t("streamsettings.NoStreamingDestina")}
305
+ <br />
306
+
307
+ {t("streamsettings.InstallAStreaming")}
308
+ </div>
309
+ ) : (
310
+ <div className="flex flex-col gap-2">
311
+ {destinations.map((d) => {
312
+ const active = d.id === activeDestination?.id;
313
+ return (
314
+ <Button
315
+ key={d.id}
316
+ disabled={streamLive}
317
+ variant="outline"
318
+ title={
319
+ streamLive
320
+ ? t("streamsettings.StopStreamToChangeChannel")
321
+ : undefined
322
+ }
323
+ onClick={() => onDestinationChange(d.id)}
324
+ className={`w-full flex items-center justify-start gap-3 px-4 py-3 h-auto rounded-lg border transition-colors disabled:opacity-50 text-left ${
325
+ active
326
+ ? "border-accent/60 bg-accent/10"
327
+ : "border-border bg-white/[0.03] hover:border-accent/30 hover:bg-white/[0.05]"
328
+ }`}
329
+ >
330
+ <span
331
+ className={`w-2.5 h-2.5 rounded-full flex-shrink-0 ${
332
+ active
333
+ ? "bg-accent shadow-[0_0_6px_theme(colors.accent.DEFAULT)]"
334
+ : "bg-muted/30"
335
+ }`}
336
+ />
337
+ <span
338
+ className={`text-[13px] font-medium ${active ? "text-txt" : "text-txt"}`}
339
+ >
340
+ {d.name}
341
+ </span>
342
+ {active && (
343
+ <span className="ml-auto text-[10px] text-txt font-semibold uppercase tracking-wide">
344
+ {t("appsview.Active")}
345
+ </span>
346
+ )}
347
+ </Button>
348
+ );
349
+ })}
350
+ </div>
351
+ )}
352
+
353
+ {streamLive && (
354
+ <p className="text-[11px] text-[#f59e0b] border border-[#f59e0b]/30 rounded px-3 py-1.5 bg-[#f59e0b]/5">
355
+ {t("streamsettings.StreamIsLiveSt")}
356
+ </p>
357
+ )}
358
+ </div>
359
+ )}
360
+
361
+ {/* ── Overlay widgets ────────────────────────────────────── */}
362
+ {section === "overlays" && (
363
+ <div className="flex flex-col gap-3">
364
+ <div className="flex items-center justify-between">
365
+ <p className="text-[12px] text-muted">
366
+ {t("streamsettings.ToggleAndConfigure")}
367
+ </p>
368
+ <Button
369
+ variant="link"
370
+ size="sm"
371
+ onClick={resetLayout}
372
+ className="text-[11px] text-muted hover:text-danger transition-colors p-0 h-auto"
373
+ >
374
+ {t("streamsettings.ResetDefaults")}
375
+ </Button>
376
+ </div>
377
+
378
+ {layout.widgets.length === 0 ? (
379
+ <div className="text-[12px] text-muted border border-border rounded-lg p-4 text-center">
380
+ {t("streamsettings.NoWidgetsAvailable")}
381
+ </div>
382
+ ) : (
383
+ <div className="flex flex-col gap-2">
384
+ {layout.widgets.map((instance) => (
385
+ <WidgetRow
386
+ key={instance.id}
387
+ instance={instance}
388
+ onToggle={() => toggleWidget(instance.id)}
389
+ onUpdate={(patch) => updateWidget(instance.id, patch)}
390
+ />
391
+ ))}
392
+ </div>
393
+ )}
394
+ </div>
395
+ )}
396
+
397
+ {/* ── Stream source ──────────────────────────────────────── */}
398
+ {section === "source" && (
399
+ <div className="flex flex-col gap-3">
400
+ <p className="text-[12px] text-muted">
401
+ {t("streamsettings.ChooseWhatContent")}
402
+ </p>
403
+
404
+ {(["stream-tab", "game", "custom-url"] as StreamSourceType[]).map(
405
+ (st) => {
406
+ const isGame = st === "game";
407
+ const disabled = isGame && !activeGameViewerUrl.trim();
408
+ const active = streamSource.type === st;
409
+
410
+ return (
411
+ <div key={st}>
412
+ <Button
413
+ variant="outline"
414
+ disabled={disabled}
415
+ onClick={() => {
416
+ if (st !== "custom-url") {
417
+ onSourceChange(
418
+ st,
419
+ isGame ? activeGameViewerUrl : undefined,
420
+ );
421
+ }
422
+ }}
423
+ className={`w-full h-auto flex items-center justify-start gap-3 px-4 py-3 rounded-lg border transition-colors text-left ${
424
+ active && st !== "custom-url"
425
+ ? "border-accent/60 bg-accent/10"
426
+ : "border-border bg-white/[0.03] hover:border-accent/30 hover:bg-white/[0.05]"
427
+ }`}
428
+ >
429
+ <span
430
+ className={`w-2.5 h-2.5 rounded-full flex-shrink-0 ${
431
+ active && st !== "custom-url"
432
+ ? "bg-accent"
433
+ : "bg-muted/30"
434
+ }`}
435
+ />
436
+ <div>
437
+ <div
438
+ className={`text-[13px] font-medium ${active && st !== "custom-url" ? "text-txt" : "text-txt"}`}
439
+ >
440
+ {STREAM_SOURCE_LABELS[st]}
441
+ </div>
442
+ <div className="text-[10px] text-muted mt-1.5">
443
+ {st === "stream-tab" &&
444
+ t("streamsettings.CaptureStreamBrowserTab")}
445
+ {st === "game" &&
446
+ (activeGameViewerUrl.trim()
447
+ ? `${t("streamsettings.ActiveGame")} ${activeGameViewerUrl}`
448
+ : t("streamsettings.NoGameActive"))}
449
+ {st === "custom-url" &&
450
+ t("streamsettings.BroadcastFromCustomUrl")}
451
+ </div>
452
+ </div>
453
+ </Button>
454
+
455
+ {st === "custom-url" && (
456
+ <div
457
+ className={`mt-1 flex items-center gap-2 px-3 py-1.5 rounded-lg border transition-colors ${
458
+ active
459
+ ? "border-accent/60 bg-accent/10"
460
+ : "border-border bg-white/[0.03]"
461
+ }`}
462
+ >
463
+ <Input
464
+ placeholder={t("streamsettings.httpsYourUrlCom")}
465
+ value={customUrlInput}
466
+ onChange={(e) => setCustomUrlInput(e.target.value)}
467
+ className="flex-1 bg-transparent border-none p-0 h-auto text-xs focus-visible:ring-0 shadow-none placeholder:text-muted/40"
468
+ onKeyDown={(e) => {
469
+ if (e.key === "Enter" && customUrlValid) {
470
+ onSourceChange("custom-url", trimmedCustomUrl);
471
+ }
472
+ }}
473
+ />
474
+ <Button
475
+ variant="ghost"
476
+ size="sm"
477
+ disabled={!customUrlValid}
478
+ onClick={() => {
479
+ if (customUrlValid) {
480
+ onSourceChange("custom-url", trimmedCustomUrl);
481
+ }
482
+ }}
483
+ className="px-2 py-1 h-auto bg-accent/20 text-txt text-[11px] font-semibold hover:bg-accent/30 transition-colors"
484
+ >
485
+ {t("streamsettings.Use")}
486
+ </Button>
487
+ </div>
488
+ )}
489
+ {st === "custom-url" &&
490
+ trimmedCustomUrl &&
491
+ !customUrlValid && (
492
+ <p className="mt-1 px-1 text-[10px] text-danger">
493
+ {t("streamsettings.CustomURLsMustSta")}
494
+ </p>
495
+ )}
496
+ </div>
497
+ );
498
+ },
499
+ )}
500
+ </div>
501
+ )}
502
+ </div>
503
+ </div>
504
+ </div>
505
+ );
506
+ }
@@ -0,0 +1,94 @@
1
+ import { client } from "@elizaos/app-core/api";
2
+ import { useApp } from "@elizaos/app-core/state";
3
+ import { useCallback, useEffect, useRef, useState } from "react";
4
+
5
+ interface TerminalLine {
6
+ id: string;
7
+ type: "command" | "stdout" | "stderr" | "exit" | "error";
8
+ text: string;
9
+ ts: number;
10
+ }
11
+
12
+ export function StreamTerminal() {
13
+ const { t } = useApp();
14
+ const [lines, setLines] = useState<TerminalLine[]>([]);
15
+ const scrollRef = useRef<HTMLDivElement>(null);
16
+ const lineIdRef = useRef(0);
17
+
18
+ const addLine = useCallback((type: TerminalLine["type"], text: string) => {
19
+ const id = String(++lineIdRef.current);
20
+ setLines((prev) => {
21
+ const next = [...prev, { id, type, text, ts: Date.now() }];
22
+ return next.length > 300 ? next.slice(-300) : next;
23
+ });
24
+ }, []);
25
+
26
+ useEffect(() => {
27
+ const el = scrollRef.current;
28
+ if (el) el.scrollTop = el.scrollHeight;
29
+ });
30
+
31
+ useEffect(() => {
32
+ const unbind = client.onWsEvent(
33
+ "terminal-output",
34
+ (data: Record<string, unknown>) => {
35
+ const event = data.event as string;
36
+ switch (event) {
37
+ case "start":
38
+ addLine("command", `$ ${data.command as string}`);
39
+ break;
40
+ case "stdout":
41
+ addLine("stdout", data.data as string);
42
+ break;
43
+ case "stderr":
44
+ addLine("stderr", data.data as string);
45
+ break;
46
+ case "exit":
47
+ addLine("exit", `Process exited with code ${data.code as number}`);
48
+ break;
49
+ case "error":
50
+ addLine("error", `Error: ${data.data as string}`);
51
+ break;
52
+ }
53
+ },
54
+ );
55
+ return unbind;
56
+ }, [addLine]);
57
+
58
+ return (
59
+ <div className="h-full w-full bg-bg-muted flex flex-col">
60
+ <div className="flex items-center px-3 py-1.5 border-b border-border bg-bg shrink-0">
61
+ <span className="text-[11px] font-mono text-muted tracking-wide">
62
+ {t("streamterminal.TERMINAL")}
63
+ </span>
64
+ </div>
65
+ <div
66
+ ref={scrollRef}
67
+ className="flex-1 overflow-y-auto overflow-x-hidden px-3 py-2 font-mono text-[12px] leading-[1.6] whitespace-pre-wrap break-all"
68
+ >
69
+ {lines.length === 0 ? (
70
+ <span className="text-muted italic text-[11px]">
71
+ {t("streamterminal.WaitingForTerminal")}
72
+ </span>
73
+ ) : (
74
+ lines.map((line) => (
75
+ <div
76
+ key={line.id}
77
+ className={
78
+ line.type === "command"
79
+ ? "text-txt font-bold"
80
+ : line.type === "stderr" || line.type === "error"
81
+ ? "text-destructive"
82
+ : line.type === "exit"
83
+ ? "text-muted"
84
+ : "text-txt"
85
+ }
86
+ >
87
+ {line.text}
88
+ </div>
89
+ ))
90
+ )}
91
+ </div>
92
+ </div>
93
+ );
94
+ }