@elizaos/app-core 2.0.0-alpha.73 → 2.0.0-alpha.75

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 (1143) hide show
  1. package/App.d.ts +5 -0
  2. package/App.d.ts.map +1 -0
  3. package/App.js +220 -0
  4. package/actions/character.d.ts +39 -0
  5. package/actions/character.d.ts.map +1 -0
  6. package/actions/character.js +247 -0
  7. package/actions/chat-helpers.d.ts +47 -0
  8. package/actions/chat-helpers.d.ts.map +1 -0
  9. package/actions/chat-helpers.js +79 -0
  10. package/actions/cloud.d.ts +17 -0
  11. package/actions/cloud.d.ts.map +1 -0
  12. package/actions/cloud.js +43 -0
  13. package/actions/index.d.ts +12 -0
  14. package/actions/index.d.ts.map +1 -0
  15. package/actions/index.js +11 -0
  16. package/actions/lifecycle.d.ts +43 -0
  17. package/actions/lifecycle.d.ts.map +1 -0
  18. package/actions/lifecycle.js +118 -0
  19. package/actions/onboarding.d.ts +12 -0
  20. package/actions/onboarding.d.ts.map +1 -0
  21. package/actions/onboarding.js +26 -0
  22. package/actions/triggers.d.ts +23 -0
  23. package/actions/triggers.d.ts.map +1 -0
  24. package/actions/triggers.js +148 -0
  25. package/api/client.d.ts +2736 -0
  26. package/api/client.d.ts.map +1 -0
  27. package/api/client.js +2492 -0
  28. package/api/index.d.ts +2 -0
  29. package/api/index.d.ts.map +1 -0
  30. package/autonomy/index.d.ts +48 -0
  31. package/autonomy/index.d.ts.map +1 -0
  32. package/autonomy/index.js +330 -0
  33. package/bridge/capacitor-bridge.d.ts +153 -0
  34. package/bridge/capacitor-bridge.d.ts.map +1 -0
  35. package/bridge/capacitor-bridge.js +193 -0
  36. package/bridge/electrobun-rpc.d.ts +28 -0
  37. package/bridge/electrobun-rpc.d.ts.map +1 -0
  38. package/bridge/electrobun-rpc.js +35 -0
  39. package/bridge/electrobun-runtime.d.ts +3 -0
  40. package/bridge/electrobun-runtime.d.ts.map +1 -0
  41. package/bridge/electrobun-runtime.js +17 -0
  42. package/bridge/index.d.ts +6 -0
  43. package/bridge/index.d.ts.map +1 -0
  44. package/bridge/native-plugins.d.ts +82 -0
  45. package/bridge/native-plugins.d.ts.map +1 -0
  46. package/bridge/native-plugins.js +39 -0
  47. package/bridge/plugin-bridge.d.ts +116 -0
  48. package/bridge/plugin-bridge.d.ts.map +1 -0
  49. package/bridge/plugin-bridge.js +203 -0
  50. package/bridge/storage-bridge.d.ts +39 -0
  51. package/bridge/storage-bridge.d.ts.map +1 -0
  52. package/bridge/storage-bridge.js +135 -0
  53. package/chat/index.d.ts +57 -0
  54. package/chat/index.d.ts.map +1 -0
  55. package/chat/index.js +160 -0
  56. package/coding/index.d.ts +25 -0
  57. package/coding/index.d.ts.map +1 -0
  58. package/coding/index.js +25 -0
  59. package/components/AdvancedPageView.d.ts +17 -0
  60. package/components/AdvancedPageView.d.ts.map +1 -0
  61. package/components/AdvancedPageView.js +146 -0
  62. package/components/AgentActivityBox.d.ts +7 -0
  63. package/components/AgentActivityBox.d.ts.map +1 -0
  64. package/components/AgentActivityBox.js +25 -0
  65. package/components/ApiKeyConfig.d.ts +26 -0
  66. package/components/ApiKeyConfig.d.ts.map +1 -0
  67. package/components/ApiKeyConfig.js +119 -0
  68. package/components/AppsPageView.d.ts +7 -0
  69. package/components/AppsPageView.d.ts.map +1 -0
  70. package/components/AppsPageView.js +31 -0
  71. package/components/AppsView.d.ts +8 -0
  72. package/components/AppsView.d.ts.map +1 -0
  73. package/components/AppsView.js +149 -0
  74. package/components/AvatarLoader.d.ts +13 -0
  75. package/components/AvatarLoader.d.ts.map +1 -0
  76. package/components/AvatarLoader.js +53 -0
  77. package/components/AvatarSelector.d.ts +23 -0
  78. package/components/AvatarSelector.d.ts.map +1 -0
  79. package/components/AvatarSelector.js +105 -0
  80. package/components/BscTradePanel.d.ts +22 -0
  81. package/components/BscTradePanel.d.ts.map +1 -0
  82. package/components/BscTradePanel.js +221 -0
  83. package/components/BugReportModal.d.ts +2 -0
  84. package/components/BugReportModal.d.ts.map +1 -0
  85. package/components/BugReportModal.js +219 -0
  86. package/components/CharacterRoster.d.ts +31 -0
  87. package/components/CharacterRoster.d.ts.map +1 -0
  88. package/components/CharacterRoster.js +41 -0
  89. package/components/CharacterView.d.ts +8 -0
  90. package/components/CharacterView.d.ts.map +1 -0
  91. package/components/CharacterView.js +685 -0
  92. package/components/ChatAvatar.d.ts +8 -0
  93. package/components/ChatAvatar.d.ts.map +1 -0
  94. package/components/ChatAvatar.js +89 -0
  95. package/components/ChatComposer.d.ts +37 -0
  96. package/components/ChatComposer.d.ts.map +1 -0
  97. package/components/ChatComposer.js +136 -0
  98. package/components/ChatMessage.d.ts +24 -0
  99. package/components/ChatMessage.d.ts.map +1 -0
  100. package/components/ChatMessage.js +167 -0
  101. package/components/ChatModalView.d.ts +10 -0
  102. package/components/ChatModalView.d.ts.map +1 -0
  103. package/components/ChatModalView.js +57 -0
  104. package/components/ChatView.d.ts +14 -0
  105. package/components/ChatView.d.ts.map +1 -0
  106. package/components/ChatView.js +526 -0
  107. package/components/CloudOnboarding.d.ts +7 -0
  108. package/components/CloudOnboarding.d.ts.map +1 -0
  109. package/components/CloudOnboarding.js +22 -0
  110. package/components/CloudSourceControls.d.ts +13 -0
  111. package/components/CloudSourceControls.d.ts.map +1 -0
  112. package/components/CloudSourceControls.js +16 -0
  113. package/components/CodingAgentSettingsSection.d.ts +2 -0
  114. package/components/CodingAgentSettingsSection.d.ts.map +1 -0
  115. package/components/CodingAgentSettingsSection.js +270 -0
  116. package/components/CommandPalette.d.ts +2 -0
  117. package/components/CommandPalette.d.ts.map +1 -0
  118. package/components/CommandPalette.js +181 -0
  119. package/components/CompanionSceneHost.d.ts +14 -0
  120. package/components/CompanionSceneHost.d.ts.map +1 -0
  121. package/components/CompanionSceneHost.js +360 -0
  122. package/components/CompanionShell.d.ts +17 -0
  123. package/components/CompanionShell.d.ts.map +1 -0
  124. package/components/CompanionShell.js +15 -0
  125. package/components/CompanionView.d.ts +2 -0
  126. package/components/CompanionView.d.ts.map +1 -0
  127. package/components/CompanionView.js +22 -0
  128. package/components/ConfigPageView.d.ts +11 -0
  129. package/components/ConfigPageView.d.ts.map +1 -0
  130. package/components/ConfigPageView.js +303 -0
  131. package/components/ConfigSaveFooter.d.ts +8 -0
  132. package/components/ConfigSaveFooter.d.ts.map +1 -0
  133. package/components/ConfigSaveFooter.js +10 -0
  134. package/components/ConfirmModal.d.ts +61 -0
  135. package/components/ConfirmModal.d.ts.map +1 -0
  136. package/components/ConfirmModal.js +164 -0
  137. package/components/ConnectionFailedBanner.d.ts +6 -0
  138. package/components/ConnectionFailedBanner.d.ts.map +1 -0
  139. package/components/ConnectionFailedBanner.js +22 -0
  140. package/components/ConnectorsPageView.d.ts +7 -0
  141. package/components/ConnectorsPageView.d.ts.map +1 -0
  142. package/components/ConnectorsPageView.js +8 -0
  143. package/components/ConversationsSidebar.d.ts +9 -0
  144. package/components/ConversationsSidebar.d.ts.map +1 -0
  145. package/components/ConversationsSidebar.js +116 -0
  146. package/components/CustomActionEditor.d.ts +10 -0
  147. package/components/CustomActionEditor.d.ts.map +1 -0
  148. package/components/CustomActionEditor.js +578 -0
  149. package/components/CustomActionsPanel.d.ts +9 -0
  150. package/components/CustomActionsPanel.d.ts.map +1 -0
  151. package/components/CustomActionsPanel.js +107 -0
  152. package/components/CustomActionsView.d.ts +2 -0
  153. package/components/CustomActionsView.d.ts.map +1 -0
  154. package/components/CustomActionsView.js +134 -0
  155. package/components/DatabasePageView.d.ts +5 -0
  156. package/components/DatabasePageView.d.ts.map +1 -0
  157. package/components/DatabasePageView.js +28 -0
  158. package/components/DatabaseView.d.ts +9 -0
  159. package/components/DatabaseView.d.ts.map +1 -0
  160. package/components/DatabaseView.js +311 -0
  161. package/components/ElizaCloudDashboard.d.ts +2 -0
  162. package/components/ElizaCloudDashboard.d.ts.map +1 -0
  163. package/components/ElizaCloudDashboard.js +657 -0
  164. package/components/EmotePicker.d.ts +2 -0
  165. package/components/EmotePicker.d.ts.map +1 -0
  166. package/components/EmotePicker.js +343 -0
  167. package/components/ErrorBoundary.d.ts +22 -0
  168. package/components/ErrorBoundary.d.ts.map +1 -0
  169. package/components/ErrorBoundary.js +31 -0
  170. package/components/FineTuningView.d.ts +2 -0
  171. package/components/FineTuningView.d.ts.map +1 -0
  172. package/components/FineTuningView.js +433 -0
  173. package/components/FlaminaGuide.d.ts +10 -0
  174. package/components/FlaminaGuide.d.ts.map +1 -0
  175. package/components/FlaminaGuide.js +64 -0
  176. package/components/GameView.d.ts +11 -0
  177. package/components/GameView.d.ts.map +1 -0
  178. package/components/GameView.js +294 -0
  179. package/components/GameViewOverlay.d.ts +8 -0
  180. package/components/GameViewOverlay.d.ts.map +1 -0
  181. package/components/GameViewOverlay.js +70 -0
  182. package/components/GlobalEmoteOverlay.d.ts +2 -0
  183. package/components/GlobalEmoteOverlay.d.ts.map +1 -0
  184. package/components/GlobalEmoteOverlay.js +112 -0
  185. package/components/Header.d.ts +9 -0
  186. package/components/Header.d.ts.map +1 -0
  187. package/components/Header.js +123 -0
  188. package/components/HeartbeatsView.d.ts +2 -0
  189. package/components/HeartbeatsView.d.ts.map +1 -0
  190. package/components/HeartbeatsView.js +378 -0
  191. package/components/InventoryView.d.ts +10 -0
  192. package/components/InventoryView.d.ts.map +1 -0
  193. package/components/InventoryView.js +176 -0
  194. package/components/KnowledgeView.d.ts +20 -0
  195. package/components/KnowledgeView.d.ts.map +1 -0
  196. package/components/KnowledgeView.js +480 -0
  197. package/components/LanguageDropdown.d.ts +30 -0
  198. package/components/LanguageDropdown.d.ts.map +1 -0
  199. package/components/LanguageDropdown.js +99 -0
  200. package/components/LifoMonitorPanel.d.ts +21 -0
  201. package/components/LifoMonitorPanel.d.ts.map +1 -0
  202. package/components/LifoMonitorPanel.js +24 -0
  203. package/components/LifoSandboxView.d.ts +5 -0
  204. package/components/LifoSandboxView.d.ts.map +1 -0
  205. package/components/LifoSandboxView.js +333 -0
  206. package/components/LoadingScreen.d.ts +13 -0
  207. package/components/LoadingScreen.d.ts.map +1 -0
  208. package/components/LoadingScreen.js +70 -0
  209. package/components/LogsPageView.d.ts +2 -0
  210. package/components/LogsPageView.d.ts.map +1 -0
  211. package/components/LogsPageView.js +7 -0
  212. package/components/LogsView.d.ts +5 -0
  213. package/components/LogsView.d.ts.map +1 -0
  214. package/components/LogsView.js +71 -0
  215. package/components/MediaGalleryView.d.ts +9 -0
  216. package/components/MediaGalleryView.d.ts.map +1 -0
  217. package/components/MediaGalleryView.js +236 -0
  218. package/components/MediaSettingsSection.d.ts +11 -0
  219. package/components/MediaSettingsSection.d.ts.map +1 -0
  220. package/components/MediaSettingsSection.js +329 -0
  221. package/components/MessageContent.d.ts +51 -0
  222. package/components/MessageContent.d.ts.map +1 -0
  223. package/components/MessageContent.js +553 -0
  224. package/components/OnboardingWizard.d.ts +2 -0
  225. package/components/OnboardingWizard.d.ts.map +1 -0
  226. package/components/OnboardingWizard.js +96 -0
  227. package/components/PairingView.d.ts +5 -0
  228. package/components/PairingView.d.ts.map +1 -0
  229. package/components/PairingView.js +29 -0
  230. package/components/PermissionsSection.d.ts +20 -0
  231. package/components/PermissionsSection.d.ts.map +1 -0
  232. package/components/PermissionsSection.js +573 -0
  233. package/components/PluginsPageView.d.ts +5 -0
  234. package/components/PluginsPageView.d.ts.map +1 -0
  235. package/components/PluginsPageView.js +8 -0
  236. package/components/PluginsView.d.ts +21 -0
  237. package/components/PluginsView.d.ts.map +1 -0
  238. package/components/PluginsView.js +1534 -0
  239. package/components/ProviderSwitcher.d.ts +42 -0
  240. package/components/ProviderSwitcher.d.ts.map +1 -0
  241. package/components/ProviderSwitcher.js +493 -0
  242. package/components/RestartBanner.d.ts +2 -0
  243. package/components/RestartBanner.d.ts.map +1 -0
  244. package/components/RestartBanner.js +36 -0
  245. package/components/RuntimeView.d.ts +10 -0
  246. package/components/RuntimeView.d.ts.map +1 -0
  247. package/components/RuntimeView.js +165 -0
  248. package/components/SaveCommandModal.d.ts +12 -0
  249. package/components/SaveCommandModal.d.ts.map +1 -0
  250. package/components/SaveCommandModal.js +84 -0
  251. package/components/SecretsView.d.ts +9 -0
  252. package/components/SecretsView.d.ts.map +1 -0
  253. package/components/SecretsView.js +249 -0
  254. package/components/SettingsView.d.ts +9 -0
  255. package/components/SettingsView.d.ts.map +1 -0
  256. package/components/SettingsView.js +230 -0
  257. package/components/ShellOverlays.d.ts +8 -0
  258. package/components/ShellOverlays.d.ts.map +1 -0
  259. package/components/ShellOverlays.js +10 -0
  260. package/components/ShortcutsOverlay.d.ts +2 -0
  261. package/components/ShortcutsOverlay.d.ts.map +1 -0
  262. package/components/ShortcutsOverlay.js +79 -0
  263. package/components/SkillsView.d.ts +11 -0
  264. package/components/SkillsView.d.ts.map +1 -0
  265. package/components/SkillsView.js +358 -0
  266. package/components/StartupFailureView.d.ts +8 -0
  267. package/components/StartupFailureView.d.ts.map +1 -0
  268. package/components/StartupFailureView.js +16 -0
  269. package/components/StreamView.d.ts +16 -0
  270. package/components/StreamView.d.ts.map +1 -0
  271. package/components/StreamView.js +300 -0
  272. package/components/StripeEmbeddedCheckout.d.ts +24 -0
  273. package/components/StripeEmbeddedCheckout.d.ts.map +1 -0
  274. package/components/StripeEmbeddedCheckout.js +101 -0
  275. package/components/SubscriptionStatus.d.ts +23 -0
  276. package/components/SubscriptionStatus.d.ts.map +1 -0
  277. package/components/SubscriptionStatus.js +301 -0
  278. package/components/SystemWarningBanner.d.ts +6 -0
  279. package/components/SystemWarningBanner.d.ts.map +1 -0
  280. package/components/SystemWarningBanner.js +46 -0
  281. package/components/ThemeToggle.d.ts +21 -0
  282. package/components/ThemeToggle.d.ts.map +1 -0
  283. package/components/ThemeToggle.js +24 -0
  284. package/components/TrajectoriesView.d.ts +12 -0
  285. package/components/TrajectoriesView.d.ts.map +1 -0
  286. package/components/TrajectoriesView.js +183 -0
  287. package/components/TrajectoryDetailView.d.ts +13 -0
  288. package/components/TrajectoryDetailView.d.ts.map +1 -0
  289. package/components/TrajectoryDetailView.js +112 -0
  290. package/components/TriggersView.d.ts +2 -0
  291. package/components/TriggersView.d.ts.map +1 -0
  292. package/components/VectorBrowserView.d.ts +10 -0
  293. package/components/VectorBrowserView.d.ts.map +1 -0
  294. package/components/VectorBrowserView.js +997 -0
  295. package/components/VoiceConfigView.d.ts +11 -0
  296. package/components/VoiceConfigView.d.ts.map +1 -0
  297. package/components/VoiceConfigView.js +329 -0
  298. package/components/VrmStage.d.ts +28 -0
  299. package/components/VrmStage.d.ts.map +1 -0
  300. package/components/VrmStage.js +178 -0
  301. package/components/WhatsAppQrOverlay.d.ts +8 -0
  302. package/components/WhatsAppQrOverlay.d.ts.map +1 -0
  303. package/components/WhatsAppQrOverlay.js +63 -0
  304. package/components/apps/AppDetailPane.d.ts +15 -0
  305. package/components/apps/AppDetailPane.d.ts.map +1 -0
  306. package/components/apps/AppDetailPane.js +13 -0
  307. package/components/apps/AppsCatalogGrid.d.ts +20 -0
  308. package/components/apps/AppsCatalogGrid.d.ts.map +1 -0
  309. package/components/apps/AppsCatalogGrid.js +18 -0
  310. package/components/apps/extensions/registry.d.ts +4 -0
  311. package/components/apps/extensions/registry.d.ts.map +1 -0
  312. package/components/apps/extensions/registry.js +7 -0
  313. package/components/apps/extensions/types.d.ts +7 -0
  314. package/components/apps/extensions/types.d.ts.map +1 -0
  315. package/components/apps/extensions/types.js +1 -0
  316. package/components/apps/helpers.d.ts +7 -0
  317. package/components/apps/helpers.d.ts.map +1 -0
  318. package/components/apps/helpers.js +44 -0
  319. package/components/avatar/VrmAnimationLoader.d.ts +30 -0
  320. package/components/avatar/VrmAnimationLoader.d.ts.map +1 -0
  321. package/components/avatar/VrmAnimationLoader.js +99 -0
  322. package/components/avatar/VrmBlinkController.d.ts +37 -0
  323. package/components/avatar/VrmBlinkController.d.ts.map +1 -0
  324. package/components/avatar/VrmBlinkController.js +98 -0
  325. package/components/avatar/VrmCameraManager.d.ts +57 -0
  326. package/components/avatar/VrmCameraManager.d.ts.map +1 -0
  327. package/components/avatar/VrmCameraManager.js +277 -0
  328. package/components/avatar/VrmEngine.d.ts +246 -0
  329. package/components/avatar/VrmEngine.d.ts.map +1 -0
  330. package/components/avatar/VrmEngine.js +2076 -0
  331. package/components/avatar/VrmFootShadow.d.ts +18 -0
  332. package/components/avatar/VrmFootShadow.d.ts.map +1 -0
  333. package/components/avatar/VrmFootShadow.js +83 -0
  334. package/components/avatar/VrmViewer.d.ts +60 -0
  335. package/components/avatar/VrmViewer.d.ts.map +1 -0
  336. package/components/avatar/VrmViewer.js +396 -0
  337. package/components/avatar/mixamoVRMRigMap.d.ts +3 -0
  338. package/components/avatar/mixamoVRMRigMap.d.ts.map +1 -0
  339. package/components/avatar/mixamoVRMRigMap.js +56 -0
  340. package/components/avatar/retargetMixamoFbxToVrm.d.ts +9 -0
  341. package/components/avatar/retargetMixamoFbxToVrm.d.ts.map +1 -0
  342. package/components/avatar/retargetMixamoFbxToVrm.js +88 -0
  343. package/components/avatar/retargetMixamoGltfToVrm.d.ts +11 -0
  344. package/components/avatar/retargetMixamoGltfToVrm.d.ts.map +1 -0
  345. package/components/avatar/retargetMixamoGltfToVrm.js +80 -0
  346. package/components/chainConfig.d.ts +89 -0
  347. package/components/chainConfig.d.ts.map +1 -0
  348. package/components/chainConfig.js +287 -0
  349. package/components/companion/CompanionHeader.d.ts +15 -0
  350. package/components/companion/CompanionHeader.d.ts.map +1 -0
  351. package/components/companion/CompanionHeader.js +7 -0
  352. package/components/companion/CompanionSceneHost.d.ts +2 -0
  353. package/components/companion/CompanionSceneHost.d.ts.map +1 -0
  354. package/components/companion/CompanionSceneHost.js +1 -0
  355. package/components/companion/VrmStage.d.ts +3 -0
  356. package/components/companion/VrmStage.d.ts.map +1 -0
  357. package/components/companion/VrmStage.js +1 -0
  358. package/components/companion/index.d.ts +18 -0
  359. package/components/companion/index.d.ts.map +1 -0
  360. package/components/companion/index.js +17 -0
  361. package/components/companion/walletUtils.d.ts +95 -0
  362. package/components/companion/walletUtils.d.ts.map +1 -0
  363. package/components/companion/walletUtils.js +167 -0
  364. package/components/companion-shell-styles.d.ts +38 -0
  365. package/components/companion-shell-styles.d.ts.map +1 -0
  366. package/components/companion-shell-styles.js +248 -0
  367. package/components/confirm-delete-control.d.ts +16 -0
  368. package/components/confirm-delete-control.d.ts.map +1 -0
  369. package/components/confirm-delete-control.js +12 -0
  370. package/components/conversations/ConversationListItem.d.ts +31 -0
  371. package/components/conversations/ConversationListItem.d.ts.map +1 -0
  372. package/components/conversations/ConversationListItem.js +52 -0
  373. package/components/conversations/conversation-utils.d.ts +9 -0
  374. package/components/conversations/conversation-utils.d.ts.map +1 -0
  375. package/components/conversations/conversation-utils.js +138 -0
  376. package/components/format.d.ts +54 -0
  377. package/components/format.d.ts.map +1 -0
  378. package/components/format.js +82 -0
  379. package/components/index.d.ts +96 -0
  380. package/components/index.d.ts.map +1 -0
  381. package/components/index.js +95 -0
  382. package/components/inventory/CopyableAddress.d.ts +8 -0
  383. package/components/inventory/CopyableAddress.d.ts.map +1 -0
  384. package/components/inventory/CopyableAddress.js +18 -0
  385. package/components/inventory/InventoryToolbar.d.ts +25 -0
  386. package/components/inventory/InventoryToolbar.d.ts.map +1 -0
  387. package/components/inventory/InventoryToolbar.js +28 -0
  388. package/components/inventory/NftGrid.d.ts +13 -0
  389. package/components/inventory/NftGrid.d.ts.map +1 -0
  390. package/components/inventory/NftGrid.js +29 -0
  391. package/components/inventory/TokenLogo.d.ts +12 -0
  392. package/components/inventory/TokenLogo.d.ts.map +1 -0
  393. package/components/inventory/TokenLogo.js +33 -0
  394. package/components/inventory/TokensTable.d.ts +24 -0
  395. package/components/inventory/TokensTable.d.ts.map +1 -0
  396. package/components/inventory/TokensTable.js +26 -0
  397. package/components/inventory/constants.d.ts +52 -0
  398. package/components/inventory/constants.d.ts.map +1 -0
  399. package/components/inventory/constants.js +121 -0
  400. package/components/inventory/index.d.ts +9 -0
  401. package/components/inventory/index.d.ts.map +1 -0
  402. package/components/inventory/index.js +8 -0
  403. package/components/inventory/media-url.d.ts +6 -0
  404. package/components/inventory/media-url.d.ts.map +1 -0
  405. package/components/inventory/media-url.js +28 -0
  406. package/components/inventory/useInventoryData.d.ts +53 -0
  407. package/components/inventory/useInventoryData.d.ts.map +1 -0
  408. package/components/inventory/useInventoryData.js +332 -0
  409. package/components/knowledge-upload-image.d.ts +27 -0
  410. package/components/knowledge-upload-image.d.ts.map +1 -0
  411. package/components/knowledge-upload-image.js +146 -0
  412. package/components/labels.d.ts +6 -0
  413. package/components/labels.d.ts.map +1 -0
  414. package/components/labels.js +40 -0
  415. package/components/onboarding/ActivateStep.d.ts +2 -0
  416. package/components/onboarding/ActivateStep.d.ts.map +1 -0
  417. package/components/onboarding/ActivateStep.js +10 -0
  418. package/components/onboarding/ConnectionStep.d.ts +2 -0
  419. package/components/onboarding/ConnectionStep.d.ts.map +1 -0
  420. package/components/onboarding/ConnectionStep.js +609 -0
  421. package/components/onboarding/IdentityStep.d.ts +2 -0
  422. package/components/onboarding/IdentityStep.d.ts.map +1 -0
  423. package/components/onboarding/IdentityStep.js +102 -0
  424. package/components/onboarding/OnboardingPanel.d.ts +9 -0
  425. package/components/onboarding/OnboardingPanel.d.ts.map +1 -0
  426. package/components/onboarding/OnboardingPanel.js +24 -0
  427. package/components/onboarding/OnboardingStepNav.d.ts +2 -0
  428. package/components/onboarding/OnboardingStepNav.d.ts.map +1 -0
  429. package/components/onboarding/OnboardingStepNav.js +23 -0
  430. package/components/onboarding/PermissionsStep.d.ts +2 -0
  431. package/components/onboarding/PermissionsStep.d.ts.map +1 -0
  432. package/components/onboarding/PermissionsStep.js +7 -0
  433. package/components/onboarding/RpcStep.d.ts +2 -0
  434. package/components/onboarding/RpcStep.d.ts.map +1 -0
  435. package/components/onboarding/RpcStep.js +125 -0
  436. package/components/permissions/PermissionIcon.d.ts +4 -0
  437. package/components/permissions/PermissionIcon.d.ts.map +1 -0
  438. package/components/permissions/PermissionIcon.js +12 -0
  439. package/components/permissions/StreamingPermissions.d.ts +20 -0
  440. package/components/permissions/StreamingPermissions.d.ts.map +1 -0
  441. package/components/permissions/StreamingPermissions.js +177 -0
  442. package/components/plugins/showcase-data.d.ts +7 -0
  443. package/components/plugins/showcase-data.d.ts.map +1 -0
  444. package/components/plugins/showcase-data.js +464 -0
  445. package/components/shared/ShellHeaderControls.d.ts +27 -0
  446. package/components/shared/ShellHeaderControls.d.ts.map +1 -0
  447. package/components/shared/ShellHeaderControls.js +60 -0
  448. package/components/shared-companion-scene-context.d.ts +3 -0
  449. package/components/shared-companion-scene-context.d.ts.map +1 -0
  450. package/components/shared-companion-scene-context.js +13 -0
  451. package/components/skeletons.d.ts +17 -0
  452. package/components/skeletons.d.ts.map +1 -0
  453. package/components/skeletons.js +22 -0
  454. package/components/stream/ActivityFeed.d.ts +5 -0
  455. package/components/stream/ActivityFeed.d.ts.map +1 -0
  456. package/components/stream/ActivityFeed.js +57 -0
  457. package/components/stream/AvatarPip.d.ts +5 -0
  458. package/components/stream/AvatarPip.d.ts.map +1 -0
  459. package/components/stream/AvatarPip.js +6 -0
  460. package/components/stream/ChatContent.d.ts +6 -0
  461. package/components/stream/ChatContent.d.ts.map +1 -0
  462. package/components/stream/ChatContent.js +69 -0
  463. package/components/stream/ChatTicker.d.ts +5 -0
  464. package/components/stream/ChatTicker.d.ts.map +1 -0
  465. package/components/stream/ChatTicker.js +34 -0
  466. package/components/stream/IdleContent.d.ts +5 -0
  467. package/components/stream/IdleContent.d.ts.map +1 -0
  468. package/components/stream/IdleContent.js +17 -0
  469. package/components/stream/StatusBar.d.ts +36 -0
  470. package/components/stream/StatusBar.d.ts.map +1 -0
  471. package/components/stream/StatusBar.js +140 -0
  472. package/components/stream/StreamSettings.d.ts +33 -0
  473. package/components/stream/StreamSettings.d.ts.map +1 -0
  474. package/components/stream/StreamSettings.js +99 -0
  475. package/components/stream/StreamTerminal.d.ts +2 -0
  476. package/components/stream/StreamTerminal.d.ts.map +1 -0
  477. package/components/stream/StreamTerminal.js +52 -0
  478. package/components/stream/StreamVoiceConfig.d.ts +10 -0
  479. package/components/stream/StreamVoiceConfig.d.ts.map +1 -0
  480. package/components/stream/StreamVoiceConfig.js +88 -0
  481. package/components/stream/helpers.d.ts +32 -0
  482. package/components/stream/helpers.d.ts.map +1 -0
  483. package/components/stream/helpers.js +110 -0
  484. package/components/stream/overlays/OverlayLayer.d.ts +20 -0
  485. package/components/stream/overlays/OverlayLayer.d.ts.map +1 -0
  486. package/components/stream/overlays/OverlayLayer.js +24 -0
  487. package/components/stream/overlays/built-in/ActionTickerWidget.d.ts +8 -0
  488. package/components/stream/overlays/built-in/ActionTickerWidget.d.ts.map +1 -0
  489. package/components/stream/overlays/built-in/ActionTickerWidget.js +44 -0
  490. package/components/stream/overlays/built-in/AlertPopupWidget.d.ts +7 -0
  491. package/components/stream/overlays/built-in/AlertPopupWidget.d.ts.map +1 -0
  492. package/components/stream/overlays/built-in/AlertPopupWidget.js +62 -0
  493. package/components/stream/overlays/built-in/BrandingWidget.d.ts +7 -0
  494. package/components/stream/overlays/built-in/BrandingWidget.d.ts.map +1 -0
  495. package/components/stream/overlays/built-in/BrandingWidget.js +36 -0
  496. package/components/stream/overlays/built-in/CustomHtmlWidget.d.ts +26 -0
  497. package/components/stream/overlays/built-in/CustomHtmlWidget.d.ts.map +1 -0
  498. package/components/stream/overlays/built-in/CustomHtmlWidget.js +78 -0
  499. package/components/stream/overlays/built-in/PeonGlassWidget.d.ts +11 -0
  500. package/components/stream/overlays/built-in/PeonGlassWidget.d.ts.map +1 -0
  501. package/components/stream/overlays/built-in/PeonGlassWidget.js +188 -0
  502. package/components/stream/overlays/built-in/PeonHudWidget.d.ts +10 -0
  503. package/components/stream/overlays/built-in/PeonHudWidget.d.ts.map +1 -0
  504. package/components/stream/overlays/built-in/PeonHudWidget.js +168 -0
  505. package/components/stream/overlays/built-in/PeonSakuraWidget.d.ts +11 -0
  506. package/components/stream/overlays/built-in/PeonSakuraWidget.d.ts.map +1 -0
  507. package/components/stream/overlays/built-in/PeonSakuraWidget.js +213 -0
  508. package/components/stream/overlays/built-in/ThoughtBubbleWidget.d.ts +8 -0
  509. package/components/stream/overlays/built-in/ThoughtBubbleWidget.d.ts.map +1 -0
  510. package/components/stream/overlays/built-in/ThoughtBubbleWidget.js +59 -0
  511. package/components/stream/overlays/built-in/ViewerCountWidget.d.ts +7 -0
  512. package/components/stream/overlays/built-in/ViewerCountWidget.d.ts.map +1 -0
  513. package/components/stream/overlays/built-in/ViewerCountWidget.js +34 -0
  514. package/components/stream/overlays/built-in/index.d.ts +13 -0
  515. package/components/stream/overlays/built-in/index.d.ts.map +1 -0
  516. package/components/stream/overlays/built-in/index.js +12 -0
  517. package/components/stream/overlays/registry.d.ts +11 -0
  518. package/components/stream/overlays/registry.d.ts.map +1 -0
  519. package/components/stream/overlays/registry.js +16 -0
  520. package/components/stream/overlays/types.d.ts +67 -0
  521. package/components/stream/overlays/types.d.ts.map +1 -0
  522. package/components/stream/overlays/types.js +7 -0
  523. package/components/stream/overlays/useOverlayLayout.d.ts +27 -0
  524. package/components/stream/overlays/useOverlayLayout.d.ts.map +1 -0
  525. package/components/stream/overlays/useOverlayLayout.js +162 -0
  526. package/components/trajectory-format.d.ts +6 -0
  527. package/components/trajectory-format.d.ts.map +1 -0
  528. package/components/trajectory-format.js +43 -0
  529. package/components/ui-badges.d.ts +23 -0
  530. package/components/ui-badges.d.ts.map +1 -0
  531. package/components/ui-badges.js +38 -0
  532. package/components/ui-switch.d.ts +14 -0
  533. package/components/ui-switch.d.ts.map +1 -0
  534. package/components/ui-switch.js +15 -0
  535. package/components/vector-browser-three.d.ts +4 -0
  536. package/components/vector-browser-three.d.ts.map +1 -0
  537. package/components/vector-browser-three.js +21 -0
  538. package/config/branding.d.ts +49 -0
  539. package/config/branding.d.ts.map +1 -0
  540. package/config/branding.js +16 -0
  541. package/config/config-catalog.d.ts +376 -0
  542. package/config/config-catalog.d.ts.map +1 -0
  543. package/config/config-catalog.js +724 -0
  544. package/config/config-field.d.ts +68 -0
  545. package/config/config-field.d.ts.map +1 -0
  546. package/config/config-field.js +840 -0
  547. package/config/config-renderer.d.ts +176 -0
  548. package/config/config-renderer.d.ts.map +1 -0
  549. package/config/config-renderer.js +405 -0
  550. package/config/index.d.ts +6 -0
  551. package/config/index.d.ts.map +1 -0
  552. package/config/index.js +5 -0
  553. package/config/ui-renderer.d.ts +26 -0
  554. package/config/ui-renderer.d.ts.map +1 -0
  555. package/config/ui-renderer.js +815 -0
  556. package/config/ui-spec.d.ts +164 -0
  557. package/config/ui-spec.d.ts.map +1 -0
  558. package/config/ui-spec.js +13 -0
  559. package/events/index.d.ts +47 -0
  560. package/events/index.d.ts.map +1 -0
  561. package/events/index.js +43 -0
  562. package/hooks/index.d.ts +15 -0
  563. package/hooks/index.d.ts.map +1 -0
  564. package/hooks/useBugReport.d.ts +14 -0
  565. package/hooks/useBugReport.d.ts.map +1 -0
  566. package/hooks/useBugReport.js +18 -0
  567. package/hooks/useCanvasWindow.d.ts +38 -0
  568. package/hooks/useCanvasWindow.d.ts.map +1 -0
  569. package/hooks/useCanvasWindow.js +273 -0
  570. package/hooks/useChatAvatarVoice.d.ts +10 -0
  571. package/hooks/useChatAvatarVoice.d.ts.map +1 -0
  572. package/hooks/useChatAvatarVoice.js +71 -0
  573. package/hooks/useClickOutside.d.ts +6 -0
  574. package/hooks/useClickOutside.d.ts.map +1 -0
  575. package/hooks/useClickOutside.js +25 -0
  576. package/hooks/useContextMenu.d.ts +17 -0
  577. package/hooks/useContextMenu.d.ts.map +1 -0
  578. package/hooks/useContextMenu.js +100 -0
  579. package/hooks/useKeyboardShortcuts.d.ts +17 -0
  580. package/hooks/useKeyboardShortcuts.d.ts.map +1 -0
  581. package/hooks/useKeyboardShortcuts.js +67 -0
  582. package/hooks/useLifoSync.d.ts +18 -0
  583. package/hooks/useLifoSync.d.ts.map +1 -0
  584. package/hooks/useLifoSync.js +113 -0
  585. package/hooks/useMemoryMonitor.d.ts +87 -0
  586. package/hooks/useMemoryMonitor.d.ts.map +1 -0
  587. package/hooks/useMemoryMonitor.js +209 -0
  588. package/hooks/useRenderGuard.d.ts +17 -0
  589. package/hooks/useRenderGuard.d.ts.map +1 -0
  590. package/hooks/useRenderGuard.js +36 -0
  591. package/hooks/useRetakeCapture.d.ts +12 -0
  592. package/hooks/useRetakeCapture.d.ts.map +1 -0
  593. package/hooks/useRetakeCapture.js +60 -0
  594. package/hooks/useStreamPopoutNavigation.d.ts +3 -0
  595. package/hooks/useStreamPopoutNavigation.d.ts.map +1 -0
  596. package/hooks/useStreamPopoutNavigation.js +17 -0
  597. package/hooks/useTimeout.d.ts +11 -0
  598. package/hooks/useTimeout.d.ts.map +1 -0
  599. package/hooks/useTimeout.js +32 -0
  600. package/hooks/useVoiceChat.d.ts +94 -0
  601. package/hooks/useVoiceChat.d.ts.map +1 -0
  602. package/hooks/useVoiceChat.js +1074 -0
  603. package/hooks/useWhatsAppPairing.d.ts +11 -0
  604. package/hooks/useWhatsAppPairing.d.ts.map +1 -0
  605. package/hooks/useWhatsAppPairing.js +95 -0
  606. package/i18n/index.d.ts +7 -0
  607. package/i18n/index.d.ts.map +1 -0
  608. package/i18n/index.js +53 -0
  609. package/i18n/locales/en.json +1239 -0
  610. package/i18n/locales/es.json +1236 -0
  611. package/i18n/locales/ko.json +1236 -0
  612. package/i18n/locales/pt.json +1236 -0
  613. package/i18n/locales/zh-CN.json +1236 -0
  614. package/i18n/messages.d.ts +6 -0
  615. package/i18n/messages.d.ts.map +1 -0
  616. package/i18n/messages.js +14 -0
  617. package/index.d.ts +5 -0
  618. package/index.d.ts.map +1 -0
  619. package/navigation/index.d.ts +27 -0
  620. package/navigation/index.d.ts.map +1 -0
  621. package/navigation/index.js +232 -0
  622. package/onboarding-config.d.ts +25 -0
  623. package/onboarding-config.d.ts.map +1 -0
  624. package/onboarding-config.js +76 -0
  625. package/package.json +143 -53
  626. package/platform/browser-launch.d.ts +2 -0
  627. package/platform/browser-launch.d.ts.map +1 -0
  628. package/platform/browser-launch.js +109 -0
  629. package/platform/index.d.ts +14 -0
  630. package/platform/index.d.ts.map +1 -0
  631. package/platform/index.js +24 -0
  632. package/platform/init.d.ts +40 -0
  633. package/platform/init.d.ts.map +1 -0
  634. package/platform/init.js +160 -0
  635. package/platform/lifo.d.ts +51 -0
  636. package/platform/lifo.d.ts.map +1 -0
  637. package/platform/lifo.js +138 -0
  638. package/providers/index.d.ts +19 -0
  639. package/providers/index.d.ts.map +1 -0
  640. package/providers/index.js +80 -0
  641. package/shell-params.d.ts +12 -0
  642. package/shell-params.d.ts.map +1 -0
  643. package/shell-params.js +19 -0
  644. package/state/AppContext.d.ts +12 -0
  645. package/state/AppContext.d.ts.map +1 -0
  646. package/state/AppContext.js +5060 -0
  647. package/state/index.d.ts +7 -0
  648. package/state/index.d.ts.map +1 -0
  649. package/state/internal.d.ts +7 -0
  650. package/state/internal.d.ts.map +1 -0
  651. package/state/internal.js +6 -0
  652. package/state/onboarding-resume.d.ts +11 -0
  653. package/state/onboarding-resume.d.ts.map +1 -0
  654. package/state/onboarding-resume.js +189 -0
  655. package/state/parsers.d.ts +26 -0
  656. package/state/parsers.d.ts.map +1 -0
  657. package/state/parsers.js +255 -0
  658. package/state/persistence.d.ts +59 -0
  659. package/state/persistence.d.ts.map +1 -0
  660. package/state/persistence.js +326 -0
  661. package/state/shell-routing.d.ts +12 -0
  662. package/state/shell-routing.d.ts.map +1 -0
  663. package/state/shell-routing.js +25 -0
  664. package/state/types.d.ts +421 -0
  665. package/state/types.d.ts.map +1 -0
  666. package/state/types.js +75 -0
  667. package/state/ui-preferences.d.ts +3 -0
  668. package/state/ui-preferences.d.ts.map +1 -0
  669. package/state/ui-preferences.js +1 -0
  670. package/state/useApp.d.ts +4 -0
  671. package/state/useApp.d.ts.map +1 -0
  672. package/state/useApp.js +22 -0
  673. package/state/vrm.d.ts +30 -0
  674. package/state/vrm.d.ts.map +1 -0
  675. package/state/vrm.js +82 -0
  676. package/styles/anime.css +6321 -0
  677. package/styles/onboarding-game.css +1092 -0
  678. package/types/index.d.ts +657 -0
  679. package/types/index.d.ts.map +1 -0
  680. package/types/index.js +1 -0
  681. package/utils/asset-url.d.ts +26 -0
  682. package/utils/asset-url.d.ts.map +1 -0
  683. package/utils/asset-url.js +99 -0
  684. package/utils/assistant-text.d.ts +2 -0
  685. package/utils/assistant-text.d.ts.map +1 -0
  686. package/utils/assistant-text.js +161 -0
  687. package/utils/clipboard.d.ts +2 -0
  688. package/utils/clipboard.d.ts.map +1 -0
  689. package/utils/clipboard.js +38 -0
  690. package/utils/desktop-dialogs.d.ts +19 -0
  691. package/utils/desktop-dialogs.d.ts.map +1 -0
  692. package/utils/desktop-dialogs.js +50 -0
  693. package/utils/eliza-globals.d.ts +11 -0
  694. package/utils/eliza-globals.d.ts.map +1 -0
  695. package/utils/eliza-globals.js +33 -0
  696. package/utils/index.d.ts +8 -0
  697. package/utils/index.d.ts.map +1 -0
  698. package/utils/number-parsing.d.ts +44 -0
  699. package/utils/number-parsing.d.ts.map +1 -0
  700. package/utils/number-parsing.js +56 -0
  701. package/utils/openExternalUrl.d.ts +2 -0
  702. package/utils/openExternalUrl.d.ts.map +1 -0
  703. package/utils/openExternalUrl.js +17 -0
  704. package/utils/spoken-text.d.ts +2 -0
  705. package/utils/spoken-text.d.ts.map +1 -0
  706. package/utils/spoken-text.js +56 -0
  707. package/utils/streaming-text.d.ts +3 -0
  708. package/utils/streaming-text.d.ts.map +1 -0
  709. package/utils/streaming-text.js +87 -0
  710. package/voice/index.d.ts +2 -0
  711. package/voice/index.d.ts.map +1 -0
  712. package/voice/types.d.ts +25 -0
  713. package/voice/types.d.ts.map +1 -0
  714. package/voice/types.js +166 -0
  715. package/wallet-rpc.d.ts +8 -0
  716. package/wallet-rpc.d.ts.map +1 -0
  717. package/wallet-rpc.js +131 -0
  718. package/.turbo/turbo-build.log +0 -5
  719. package/src/App.tsx +0 -504
  720. package/src/actions/character.test.ts +0 -139
  721. package/src/actions/character.ts +0 -334
  722. package/src/actions/chat-helpers.ts +0 -100
  723. package/src/actions/cloud.ts +0 -59
  724. package/src/actions/index.ts +0 -12
  725. package/src/actions/lifecycle.ts +0 -175
  726. package/src/actions/onboarding.ts +0 -38
  727. package/src/actions/triggers.ts +0 -190
  728. package/src/ambient.d.ts +0 -33
  729. package/src/api/client.ts +0 -5659
  730. package/src/autonomy/index.ts +0 -477
  731. package/src/bridge/capacitor-bridge.ts +0 -295
  732. package/src/bridge/electrobun-rpc.ts +0 -78
  733. package/src/bridge/electrobun-runtime.ts +0 -28
  734. package/src/bridge/native-plugins.ts +0 -138
  735. package/src/bridge/plugin-bridge.ts +0 -352
  736. package/src/bridge/storage-bridge.ts +0 -162
  737. package/src/chat/index.ts +0 -250
  738. package/src/coding/index.ts +0 -43
  739. package/src/components/AdvancedPageView.tsx +0 -382
  740. package/src/components/AgentActivityBox.tsx +0 -49
  741. package/src/components/ApiKeyConfig.tsx +0 -222
  742. package/src/components/AppsPageView.tsx +0 -52
  743. package/src/components/AppsView.tsx +0 -293
  744. package/src/components/AvatarLoader.tsx +0 -104
  745. package/src/components/AvatarSelector.tsx +0 -223
  746. package/src/components/BscTradePanel.tsx +0 -549
  747. package/src/components/BugReportModal.tsx +0 -499
  748. package/src/components/CharacterRoster.tsx +0 -143
  749. package/src/components/CharacterView.tsx +0 -1575
  750. package/src/components/ChatAvatar.test.ts +0 -97
  751. package/src/components/ChatAvatar.tsx +0 -147
  752. package/src/components/ChatComposer.tsx +0 -330
  753. package/src/components/ChatMessage.tsx +0 -448
  754. package/src/components/ChatModalView.test.tsx +0 -118
  755. package/src/components/ChatModalView.tsx +0 -125
  756. package/src/components/ChatView.tsx +0 -992
  757. package/src/components/CloudOnboarding.tsx +0 -81
  758. package/src/components/CloudSourceControls.tsx +0 -85
  759. package/src/components/CodingAgentSettingsSection.tsx +0 -537
  760. package/src/components/CommandPalette.tsx +0 -284
  761. package/src/components/CompanionSceneHost.tsx +0 -517
  762. package/src/components/CompanionShell.tsx +0 -31
  763. package/src/components/CompanionView.tsx +0 -110
  764. package/src/components/ConfigPageView.tsx +0 -763
  765. package/src/components/ConfigSaveFooter.tsx +0 -41
  766. package/src/components/ConfirmModal.tsx +0 -379
  767. package/src/components/ConnectionFailedBanner.tsx +0 -91
  768. package/src/components/ConnectorsPageView.tsx +0 -13
  769. package/src/components/ConversationsSidebar.tsx +0 -279
  770. package/src/components/CustomActionEditor.tsx +0 -1127
  771. package/src/components/CustomActionsPanel.tsx +0 -288
  772. package/src/components/CustomActionsView.tsx +0 -325
  773. package/src/components/DatabasePageView.tsx +0 -55
  774. package/src/components/DatabaseView.tsx +0 -814
  775. package/src/components/ElizaCloudDashboard.tsx +0 -1696
  776. package/src/components/EmotePicker.tsx +0 -529
  777. package/src/components/ErrorBoundary.tsx +0 -76
  778. package/src/components/FineTuningView.tsx +0 -1080
  779. package/src/components/FlaminaGuide.test.tsx +0 -61
  780. package/src/components/FlaminaGuide.tsx +0 -212
  781. package/src/components/GameView.tsx +0 -551
  782. package/src/components/GameViewOverlay.tsx +0 -133
  783. package/src/components/GlobalEmoteOverlay.tsx +0 -152
  784. package/src/components/Header.test.tsx +0 -413
  785. package/src/components/Header.tsx +0 -400
  786. package/src/components/HeartbeatsView.tsx +0 -1003
  787. package/src/components/InventoryView.tsx +0 -393
  788. package/src/components/KnowledgeView.tsx +0 -1128
  789. package/src/components/LanguageDropdown.tsx +0 -192
  790. package/src/components/LifoMonitorPanel.tsx +0 -196
  791. package/src/components/LifoSandboxView.tsx +0 -499
  792. package/src/components/LoadingScreen.tsx +0 -112
  793. package/src/components/LogsPageView.tsx +0 -17
  794. package/src/components/LogsView.tsx +0 -239
  795. package/src/components/MediaGalleryView.tsx +0 -431
  796. package/src/components/MediaSettingsSection.tsx +0 -893
  797. package/src/components/MessageContent.tsx +0 -815
  798. package/src/components/MiladyBar.tsx +0 -103
  799. package/src/components/MiladyBarSettings.tsx +0 -872
  800. package/src/components/OnboardingWizard.test.tsx +0 -104
  801. package/src/components/OnboardingWizard.tsx +0 -249
  802. package/src/components/PairingView.tsx +0 -109
  803. package/src/components/PermissionsSection.tsx +0 -1184
  804. package/src/components/PluginsPageView.tsx +0 -9
  805. package/src/components/PluginsView.tsx +0 -3129
  806. package/src/components/ProviderSwitcher.tsx +0 -903
  807. package/src/components/RestartBanner.tsx +0 -76
  808. package/src/components/RuntimeView.tsx +0 -460
  809. package/src/components/SaveCommandModal.tsx +0 -211
  810. package/src/components/SecretsView.tsx +0 -569
  811. package/src/components/SecurityPageView.tsx +0 -242
  812. package/src/components/SettingsView.tsx +0 -825
  813. package/src/components/ShellOverlays.tsx +0 -41
  814. package/src/components/ShortcutsOverlay.tsx +0 -155
  815. package/src/components/SkillsView.tsx +0 -1435
  816. package/src/components/StartupFailureView.tsx +0 -63
  817. package/src/components/StreamView.tsx +0 -481
  818. package/src/components/StripeEmbeddedCheckout.tsx +0 -155
  819. package/src/components/SubscriptionStatus.tsx +0 -640
  820. package/src/components/SystemWarningBanner.tsx +0 -71
  821. package/src/components/ThemeToggle.tsx +0 -103
  822. package/src/components/TrajectoriesView.tsx +0 -526
  823. package/src/components/TrajectoryDetailView.tsx +0 -426
  824. package/src/components/VectorBrowserView.tsx +0 -1633
  825. package/src/components/VoiceConfigView.tsx +0 -674
  826. package/src/components/VrmStage.test.ts +0 -176
  827. package/src/components/VrmStage.tsx +0 -309
  828. package/src/components/WhatsAppQrOverlay.tsx +0 -230
  829. package/src/components/__tests__/chainConfig.test.ts +0 -220
  830. package/src/components/apps/AppDetailPane.tsx +0 -242
  831. package/src/components/apps/AppsCatalogGrid.tsx +0 -137
  832. package/src/components/apps/extensions/registry.ts +0 -13
  833. package/src/components/apps/extensions/types.ts +0 -9
  834. package/src/components/apps/helpers.ts +0 -43
  835. package/src/components/avatar/VrmAnimationLoader.test.ts +0 -164
  836. package/src/components/avatar/VrmAnimationLoader.ts +0 -151
  837. package/src/components/avatar/VrmBlinkController.ts +0 -118
  838. package/src/components/avatar/VrmCameraManager.ts +0 -407
  839. package/src/components/avatar/VrmEngine.ts +0 -2767
  840. package/src/components/avatar/VrmFootShadow.ts +0 -96
  841. package/src/components/avatar/VrmViewer.tsx +0 -421
  842. package/src/components/avatar/__tests__/VrmCameraManager.test.ts +0 -168
  843. package/src/components/avatar/__tests__/VrmEngine.test.ts +0 -1574
  844. package/src/components/avatar/mixamoVRMRigMap.ts +0 -62
  845. package/src/components/avatar/retargetMixamoFbxToVrm.ts +0 -144
  846. package/src/components/avatar/retargetMixamoGltfToVrm.ts +0 -119
  847. package/src/components/chainConfig.ts +0 -400
  848. package/src/components/companion/CompanionHeader.tsx +0 -50
  849. package/src/components/companion/CompanionSceneHost.tsx +0 -5
  850. package/src/components/companion/VrmStage.tsx +0 -2
  851. package/src/components/companion/__tests__/walletUtils.test.ts +0 -742
  852. package/src/components/companion/index.ts +0 -18
  853. package/src/components/companion/walletUtils.ts +0 -290
  854. package/src/components/companion-shell-styles.test.ts +0 -142
  855. package/src/components/companion-shell-styles.ts +0 -270
  856. package/src/components/confirm-delete-control.tsx +0 -69
  857. package/src/components/conversations/ConversationListItem.tsx +0 -185
  858. package/src/components/conversations/conversation-utils.ts +0 -151
  859. package/src/components/format.ts +0 -131
  860. package/src/components/index.ts +0 -96
  861. package/src/components/inventory/CopyableAddress.tsx +0 -41
  862. package/src/components/inventory/InventoryToolbar.tsx +0 -142
  863. package/src/components/inventory/NftGrid.tsx +0 -99
  864. package/src/components/inventory/TokenLogo.tsx +0 -71
  865. package/src/components/inventory/TokensTable.tsx +0 -216
  866. package/src/components/inventory/constants.ts +0 -170
  867. package/src/components/inventory/index.ts +0 -29
  868. package/src/components/inventory/media-url.test.ts +0 -38
  869. package/src/components/inventory/media-url.ts +0 -36
  870. package/src/components/inventory/useInventoryData.ts +0 -460
  871. package/src/components/knowledge-upload-image.ts +0 -215
  872. package/src/components/labels.ts +0 -46
  873. package/src/components/milady-bar/CloudCreditsChip.tsx +0 -61
  874. package/src/components/milady-bar/ProviderDropdown.tsx +0 -166
  875. package/src/components/milady-bar/WalletSummary.tsx +0 -61
  876. package/src/components/milady-bar/index.ts +0 -3
  877. package/src/components/onboarding/ActivateStep.tsx +0 -34
  878. package/src/components/onboarding/ConnectionStep.tsx +0 -1591
  879. package/src/components/onboarding/IdentityStep.tsx +0 -251
  880. package/src/components/onboarding/OnboardingPanel.tsx +0 -39
  881. package/src/components/onboarding/OnboardingStepNav.tsx +0 -41
  882. package/src/components/onboarding/PermissionsStep.tsx +0 -20
  883. package/src/components/onboarding/RpcStep.tsx +0 -402
  884. package/src/components/permissions/PermissionIcon.tsx +0 -25
  885. package/src/components/permissions/StreamingPermissions.tsx +0 -413
  886. package/src/components/plugins/showcase-data.ts +0 -481
  887. package/src/components/shared/ShellHeaderControls.tsx +0 -198
  888. package/src/components/shared-companion-scene-context.ts +0 -15
  889. package/src/components/skeletons.tsx +0 -88
  890. package/src/components/stream/ActivityFeed.tsx +0 -113
  891. package/src/components/stream/AvatarPip.tsx +0 -10
  892. package/src/components/stream/ChatContent.tsx +0 -126
  893. package/src/components/stream/ChatTicker.tsx +0 -55
  894. package/src/components/stream/IdleContent.tsx +0 -73
  895. package/src/components/stream/StatusBar.tsx +0 -463
  896. package/src/components/stream/StreamSettings.tsx +0 -506
  897. package/src/components/stream/StreamTerminal.tsx +0 -94
  898. package/src/components/stream/StreamVoiceConfig.tsx +0 -160
  899. package/src/components/stream/helpers.ts +0 -134
  900. package/src/components/stream/overlays/OverlayLayer.tsx +0 -75
  901. package/src/components/stream/overlays/built-in/ActionTickerWidget.tsx +0 -64
  902. package/src/components/stream/overlays/built-in/AlertPopupWidget.tsx +0 -87
  903. package/src/components/stream/overlays/built-in/BrandingWidget.tsx +0 -51
  904. package/src/components/stream/overlays/built-in/CustomHtmlWidget.tsx +0 -105
  905. package/src/components/stream/overlays/built-in/PeonGlassWidget.tsx +0 -265
  906. package/src/components/stream/overlays/built-in/PeonHudWidget.tsx +0 -247
  907. package/src/components/stream/overlays/built-in/PeonSakuraWidget.tsx +0 -278
  908. package/src/components/stream/overlays/built-in/ThoughtBubbleWidget.tsx +0 -77
  909. package/src/components/stream/overlays/built-in/ViewerCountWidget.tsx +0 -46
  910. package/src/components/stream/overlays/built-in/index.ts +0 -13
  911. package/src/components/stream/overlays/registry.ts +0 -22
  912. package/src/components/stream/overlays/types.ts +0 -90
  913. package/src/components/stream/overlays/useOverlayLayout.ts +0 -218
  914. package/src/components/trajectory-format.ts +0 -50
  915. package/src/components/ui-badges.tsx +0 -109
  916. package/src/components/ui-switch.tsx +0 -57
  917. package/src/components/vector-browser-three.ts +0 -29
  918. package/src/config/branding.ts +0 -67
  919. package/src/config/config-catalog.ts +0 -1092
  920. package/src/config/config-field.tsx +0 -1924
  921. package/src/config/config-renderer.tsx +0 -734
  922. package/src/config/index.ts +0 -12
  923. package/src/config/ui-renderer.tsx +0 -1751
  924. package/src/config/ui-spec.ts +0 -256
  925. package/src/events/index.ts +0 -96
  926. package/src/hooks/useBugReport.tsx +0 -43
  927. package/src/hooks/useCanvasWindow.ts +0 -372
  928. package/src/hooks/useChatAvatarVoice.ts +0 -111
  929. package/src/hooks/useClickOutside.ts +0 -31
  930. package/src/hooks/useContextMenu.ts +0 -127
  931. package/src/hooks/useKeyboardShortcuts.ts +0 -86
  932. package/src/hooks/useLifoSync.ts +0 -143
  933. package/src/hooks/useMemoryMonitor.ts +0 -334
  934. package/src/hooks/useMiladyBar.ts +0 -594
  935. package/src/hooks/useRenderGuard.ts +0 -43
  936. package/src/hooks/useRetakeCapture.ts +0 -68
  937. package/src/hooks/useStreamPopoutNavigation.ts +0 -27
  938. package/src/hooks/useTimeout.ts +0 -37
  939. package/src/hooks/useVoiceChat.ts +0 -1442
  940. package/src/hooks/useWhatsAppPairing.ts +0 -123
  941. package/src/i18n/index.ts +0 -76
  942. package/src/i18n/locales/en.json +0 -1195
  943. package/src/i18n/locales/es.json +0 -1195
  944. package/src/i18n/locales/ko.json +0 -1195
  945. package/src/i18n/locales/pt.json +0 -1195
  946. package/src/i18n/locales/zh-CN.json +0 -1195
  947. package/src/i18n/messages.ts +0 -21
  948. package/src/navigation/index.ts +0 -286
  949. package/src/navigation.test.ts +0 -189
  950. package/src/onboarding-config.test.ts +0 -104
  951. package/src/onboarding-config.ts +0 -122
  952. package/src/platform/browser-launch.test.ts +0 -94
  953. package/src/platform/browser-launch.ts +0 -149
  954. package/src/platform/index.ts +0 -58
  955. package/src/platform/init.ts +0 -238
  956. package/src/platform/lifo.ts +0 -225
  957. package/src/providers/index.ts +0 -108
  958. package/src/shell-params.test.ts +0 -48
  959. package/src/shell-params.ts +0 -36
  960. package/src/state/AppContext.tsx +0 -6415
  961. package/src/state/internal.ts +0 -91
  962. package/src/state/onboarding-resume.test.ts +0 -135
  963. package/src/state/onboarding-resume.ts +0 -263
  964. package/src/state/parsers.test.ts +0 -124
  965. package/src/state/parsers.ts +0 -309
  966. package/src/state/persistence.ts +0 -379
  967. package/src/state/shell-routing.ts +0 -39
  968. package/src/state/types.ts +0 -724
  969. package/src/state/ui-preferences.ts +0 -3
  970. package/src/state/useApp.ts +0 -23
  971. package/src/state/vrm.ts +0 -108
  972. package/src/styles/anime.css +0 -6324
  973. package/src/styles/onboarding-game.css +0 -976
  974. package/src/types/index.ts +0 -715
  975. package/src/types/react-test-renderer.d.ts +0 -45
  976. package/src/utils/asset-url.ts +0 -110
  977. package/src/utils/assistant-text.ts +0 -172
  978. package/src/utils/clipboard.ts +0 -41
  979. package/src/utils/desktop-dialogs.ts +0 -80
  980. package/src/utils/eliza-globals.ts +0 -44
  981. package/src/utils/number-parsing.ts +0 -125
  982. package/src/utils/openExternalUrl.ts +0 -20
  983. package/src/utils/spoken-text.ts +0 -65
  984. package/src/utils/streaming-text.ts +0 -120
  985. package/src/voice/types.ts +0 -197
  986. package/src/wallet-rpc.ts +0 -176
  987. package/test/app/AppContext.pty-sessions.test.tsx +0 -143
  988. package/test/app/MessageContent.test.tsx +0 -366
  989. package/test/app/PermissionsOnboarding.test.tsx +0 -358
  990. package/test/app/PermissionsSection.test.tsx +0 -575
  991. package/test/app/advanced-trajectory-fine-tuning.e2e.test.ts +0 -396
  992. package/test/app/agent-activity-box.test.tsx +0 -132
  993. package/test/app/agent-transfer-lock.test.ts +0 -279
  994. package/test/app/api-client-electrobun-fallback.test.ts +0 -139
  995. package/test/app/api-client-electron-fallback.test.ts +0 -139
  996. package/test/app/api-client-timeout.test.ts +0 -75
  997. package/test/app/api-client-ws.test.ts +0 -98
  998. package/test/app/api-client.ws-max-reconnect.test.ts +0 -139
  999. package/test/app/api-client.ws-reconnect.test.ts +0 -157
  1000. package/test/app/app-context-autonomy-events.test.ts +0 -559
  1001. package/test/app/apps-page-view.test.ts +0 -114
  1002. package/test/app/apps-view.test.ts +0 -768
  1003. package/test/app/autonomous-workflows.e2e.test.ts +0 -765
  1004. package/test/app/autonomy-events.test.ts +0 -150
  1005. package/test/app/avatar-selector.test.tsx +0 -52
  1006. package/test/app/bsc-trade-panel.test.tsx +0 -134
  1007. package/test/app/bug-report-modal.test.tsx +0 -353
  1008. package/test/app/character-action-bar-visibility.test.ts +0 -70
  1009. package/test/app/character-customization.e2e.test.ts +0 -1384
  1010. package/test/app/character-save-journey.test.ts +0 -1245
  1011. package/test/app/chat-advanced-features.e2e.test.ts +0 -706
  1012. package/test/app/chat-composer.test.tsx +0 -181
  1013. package/test/app/chat-journey.test.ts +0 -1075
  1014. package/test/app/chat-language-header.test.ts +0 -64
  1015. package/test/app/chat-message.test.tsx +0 -222
  1016. package/test/app/chat-modal-view.test.tsx +0 -191
  1017. package/test/app/chat-routine-filter.test.ts +0 -96
  1018. package/test/app/chat-send-lock.test.ts +0 -1465
  1019. package/test/app/chat-stream-api-client.test.tsx +0 -390
  1020. package/test/app/chat-view-game-modal.test.tsx +0 -661
  1021. package/test/app/chat-view.test.tsx +0 -877
  1022. package/test/app/cloud-api.e2e.test.ts +0 -258
  1023. package/test/app/cloud-login-flow.e2e.test.ts +0 -494
  1024. package/test/app/cloud-login-lock.test.ts +0 -416
  1025. package/test/app/command-palette.test.tsx +0 -184
  1026. package/test/app/command-registry.test.ts +0 -75
  1027. package/test/app/companion-greeting-wave.test.tsx +0 -431
  1028. package/test/app/companion-scene-host.test.tsx +0 -85
  1029. package/test/app/companion-stale-conversation.test.tsx +0 -447
  1030. package/test/app/companion-view.test.tsx +0 -690
  1031. package/test/app/confirm-delete-control.test.ts +0 -79
  1032. package/test/app/confirm-modal.test.tsx +0 -219
  1033. package/test/app/connection-mode-persistence.test.ts +0 -411
  1034. package/test/app/connectors-ui.e2e.test.ts +0 -508
  1035. package/test/app/conversations-sidebar-game-modal.test.tsx +0 -265
  1036. package/test/app/conversations-sidebar.test.tsx +0 -185
  1037. package/test/app/custom-actions-smoke.test.ts +0 -387
  1038. package/test/app/custom-avatar-api-client.test.ts +0 -207
  1039. package/test/app/desktop-utils.test.ts +0 -145
  1040. package/test/app/electrobun-rpc-bridge.test.ts +0 -83
  1041. package/test/app/events.test.ts +0 -88
  1042. package/test/app/export-import-flows.e2e.test.ts +0 -700
  1043. package/test/app/fine-tuning-view.test.ts +0 -471
  1044. package/test/app/game-view-auth-session.test.tsx +0 -187
  1045. package/test/app/game-view.test.ts +0 -444
  1046. package/test/app/global-emote-overlay.test.tsx +0 -106
  1047. package/test/app/header-status.test.tsx +0 -149
  1048. package/test/app/i18n.test.ts +0 -152
  1049. package/test/app/inventory-bsc-view.test.ts +0 -940
  1050. package/test/app/knowledge-ui.e2e.test.ts +0 -762
  1051. package/test/app/knowledge-upload-helpers.test.ts +0 -124
  1052. package/test/app/lifecycle-lock.test.ts +0 -267
  1053. package/test/app/lifo-popout-utils.test.ts +0 -208
  1054. package/test/app/lifo-safe-endpoint.test.ts +0 -34
  1055. package/test/app/loading-screen.test.tsx +0 -45
  1056. package/test/app/memory-monitor.test.ts +0 -331
  1057. package/test/app/milady-bar-regression.test.tsx +0 -519
  1058. package/test/app/milady-bar-settings.test.tsx +0 -1056
  1059. package/test/app/milady-bar.test.tsx +0 -583
  1060. package/test/app/navigation.test.tsx +0 -22
  1061. package/test/app/onboarding-e2e-journey.test.ts +0 -1409
  1062. package/test/app/onboarding-finish-lock.test.ts +0 -676
  1063. package/test/app/onboarding-language.test.tsx +0 -160
  1064. package/test/app/onboarding-steps.test.tsx +0 -375
  1065. package/test/app/open-external-url.test.ts +0 -65
  1066. package/test/app/pages-navigation-smoke.e2e.test.ts +0 -646
  1067. package/test/app/pairing-lock.test.ts +0 -260
  1068. package/test/app/pairing-view.test.tsx +0 -74
  1069. package/test/app/permissions-section.test.ts +0 -432
  1070. package/test/app/plugin-bridge.test.ts +0 -109
  1071. package/test/app/plugins-ui.e2e.test.ts +0 -605
  1072. package/test/app/plugins-view-game-modal.test.tsx +0 -686
  1073. package/test/app/plugins-view-toggle-restart.test.ts +0 -129
  1074. package/test/app/provider-dropdown-default.test.tsx +0 -300
  1075. package/test/app/restart-banner.test.tsx +0 -205
  1076. package/test/app/retake-capture.test.ts +0 -84
  1077. package/test/app/sandbox-api-client.test.ts +0 -108
  1078. package/test/app/save-command-modal.test.tsx +0 -109
  1079. package/test/app/secrets-view.test.tsx +0 -92
  1080. package/test/app/settings-control-styles.test.tsx +0 -142
  1081. package/test/app/settings-reset.e2e.test.ts +0 -726
  1082. package/test/app/settings-sections.e2e.test.ts +0 -614
  1083. package/test/app/shared-format.test.ts +0 -44
  1084. package/test/app/shared-switch.test.ts +0 -69
  1085. package/test/app/shell-mode-switching.e2e.test.ts +0 -841
  1086. package/test/app/shell-mode-tab-memory.test.tsx +0 -58
  1087. package/test/app/shell-overlays.test.tsx +0 -50
  1088. package/test/app/shortcuts-overlay.test.tsx +0 -111
  1089. package/test/app/sse-interruption.test.ts +0 -122
  1090. package/test/app/startup-asset-missing.e2e.test.ts +0 -126
  1091. package/test/app/startup-backend-missing.e2e.test.ts +0 -126
  1092. package/test/app/startup-chat.e2e.test.ts +0 -323
  1093. package/test/app/startup-conversation-restore.test.tsx +0 -381
  1094. package/test/app/startup-failure-view.test.tsx +0 -103
  1095. package/test/app/startup-onboarding.e2e.test.ts +0 -712
  1096. package/test/app/startup-timeout.test.tsx +0 -80
  1097. package/test/app/startup-token-401.e2e.test.ts +0 -103
  1098. package/test/app/stream-helpers.test.ts +0 -46
  1099. package/test/app/stream-popout-navigation.test.tsx +0 -41
  1100. package/test/app/stream-status-bar.test.tsx +0 -89
  1101. package/test/app/theme-toggle.test.tsx +0 -40
  1102. package/test/app/training-api-client.test.ts +0 -128
  1103. package/test/app/trajectories-view.test.tsx +0 -220
  1104. package/test/app/triggers-api-client.test.ts +0 -77
  1105. package/test/app/triggers-navigation.test.ts +0 -113
  1106. package/test/app/triggers-view.e2e.test.ts +0 -675
  1107. package/test/app/update-channel-lock.test.ts +0 -259
  1108. package/test/app/vector-browser.async-cleanup.test.tsx +0 -367
  1109. package/test/app/vector-browser.e2e.test.ts +0 -653
  1110. package/test/app/vrm-stage.test.tsx +0 -351
  1111. package/test/app/vrm-viewer.test.tsx +0 -298
  1112. package/test/app/wallet-api-save-lock.test.ts +0 -299
  1113. package/test/app/wallet-hooks.test.ts +0 -405
  1114. package/test/app/wallet-ui-flows.e2e.test.ts +0 -556
  1115. package/test/avatar/asset-url.test.ts +0 -90
  1116. package/test/avatar/avatar-selector.test.ts +0 -173
  1117. package/test/avatar/mixamo-vrm-rig-map.test.ts +0 -111
  1118. package/test/avatar/voice-chat-streaming-text.test.ts +0 -96
  1119. package/test/avatar/voice-chat.test.ts +0 -391
  1120. package/test/browser-extension/README.md +0 -138
  1121. package/test/browser-extension/test-harness.ts +0 -499
  1122. package/test/capacitor-plugins.e2e.test.ts +0 -168
  1123. package/test/test-types.ts +0 -5
  1124. package/test/ui/command-palette-commands.test.ts +0 -57
  1125. package/test/ui/ui-renderer.test.ts +0 -39
  1126. package/test/utils/assistant-text.test.ts +0 -68
  1127. package/test/utils/eliza-globals.test.ts +0 -59
  1128. package/test/utils/package-exports.test.ts +0 -70
  1129. package/test/utils/streaming-text.test.ts +0 -89
  1130. package/tsconfig.build.json +0 -19
  1131. package/tsconfig.json +0 -20
  1132. package/tsconfig.typecheck.json +0 -12
  1133. /package/{src/api/index.ts → api/index.js} +0 -0
  1134. /package/{src/bridge/index.ts → bridge/index.js} +0 -0
  1135. /package/{src/components/TriggersView.tsx → components/TriggersView.js} +0 -0
  1136. /package/{src/hooks/index.ts → hooks/index.js} +0 -0
  1137. /package/{src/index.ts → index.js} +0 -0
  1138. /package/{src/state/index.ts → state/index.js} +0 -0
  1139. /package/{src/styles → styles}/base.css +0 -0
  1140. /package/{src/styles → styles}/styles.css +0 -0
  1141. /package/{src/styles → styles}/xterm.css +0 -0
  1142. /package/{src/utils/index.ts → utils/index.js} +0 -0
  1143. /package/{src/voice/index.ts → voice/index.js} +0 -0
@@ -1,3129 +0,0 @@
1
- /**
2
- * Plugins view — tag-filtered plugin management.
3
- *
4
- * Renders a unified plugin list with searchable/filterable cards and per-plugin settings.
5
- */
6
-
7
- import { Button, Input } from "@elizaos/ui";
8
- import type { LucideIcon } from "lucide-react";
9
- import {
10
- Binary,
11
- BookOpen,
12
- Bot,
13
- Brain,
14
- BrickWall,
15
- Briefcase,
16
- Calendar,
17
- ChevronRight,
18
- Chrome,
19
- Circle,
20
- CircleDashed,
21
- CircleDot,
22
- ClipboardList,
23
- Clock,
24
- Cloud,
25
- Command,
26
- Construction,
27
- CreditCard,
28
- Diamond,
29
- Dna,
30
- Droplets,
31
- Eye,
32
- Feather,
33
- FileKey,
34
- FileText,
35
- Fingerprint,
36
- Gamepad,
37
- Gamepad2,
38
- Github,
39
- Handshake,
40
- Hash,
41
- Layers,
42
- Leaf,
43
- Link,
44
- Lock,
45
- LockKeyhole,
46
- Mail,
47
- MessageCircle,
48
- MessageSquare,
49
- MessagesSquare,
50
- Mic,
51
- Monitor,
52
- MousePointer2,
53
- Package,
54
- PenTool,
55
- Phone,
56
- Pickaxe,
57
- Puzzle,
58
- RefreshCw,
59
- Rss,
60
- ScrollText,
61
- Send,
62
- Server,
63
- Settings,
64
- Shell,
65
- Shuffle,
66
- Smartphone,
67
- Sparkle,
68
- Sparkles,
69
- Square,
70
- Star,
71
- StickyNote,
72
- Target,
73
- Tornado,
74
- TrendingDown,
75
- Triangle,
76
- Twitter,
77
- Video,
78
- Volume2,
79
- Wallet,
80
- Webhook,
81
- Wrench,
82
- Zap,
83
- } from "lucide-react";
84
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
85
- import type { PluginInfo, PluginParamDef } from "../api";
86
- import { client } from "../api";
87
- import {
88
- ConfigRenderer,
89
- defaultRegistry,
90
- type JsonSchemaObject,
91
- } from "../config";
92
- import { useApp } from "../state";
93
- import type { ConfigUiHint } from "../types";
94
- import { openExternalUrl, resolveAppAssetUrl } from "../utils";
95
- import { autoLabel } from "./labels";
96
- import { SHOWCASE_PLUGIN } from "./plugins/showcase-data";
97
- import { WhatsAppQrOverlay } from "./WhatsAppQrOverlay";
98
-
99
- /* ── Always-on plugins (hidden from all views) ────────────────────────── */
100
-
101
- /**
102
- * Plugin IDs hidden from Features/Connectors views.
103
- * Core plugins are visible in Admin > Plugins instead.
104
- */
105
- const ALWAYS_ON_PLUGIN_IDS = new Set([
106
- // Core (always loaded)
107
- "sql",
108
- "local-embedding",
109
- "knowledge",
110
- "agent-skills",
111
- "directives",
112
- "commands",
113
- "personality",
114
- "experience",
115
- // Optional core (shown in admin)
116
- "agent-orchestrator",
117
- "shell",
118
- "plugin-manager",
119
- "cli",
120
- "code",
121
- "edge-tts",
122
- "pdf",
123
- "scratchpad",
124
- "secrets-manager",
125
- "todo",
126
- "trust",
127
- "form",
128
- "goals",
129
- "scheduling",
130
- // Internal / infrastructure
131
- "elizacloud",
132
- "evm",
133
- "memory",
134
- "rolodex",
135
- "tts",
136
- "elevenlabs",
137
- "cron",
138
- "webhooks",
139
- "browser",
140
- "vision",
141
- "computeruse",
142
- ]);
143
-
144
- /* ── Helpers ────────────────────────────────────────────────────────── */
145
-
146
- /** Detect advanced / debug parameters that should be collapsed by default. */
147
- function isAdvancedParam(param: PluginParamDef): boolean {
148
- const k = param.key.toUpperCase();
149
- const d = (param.description ?? "").toLowerCase();
150
- return (
151
- k.includes("EXPERIMENTAL") ||
152
- k.includes("DEBUG") ||
153
- k.includes("VERBOSE") ||
154
- k.includes("TELEMETRY") ||
155
- k.includes("BROWSER_BASE") ||
156
- d.includes("experimental") ||
157
- d.includes("advanced") ||
158
- d.includes("debug")
159
- );
160
- }
161
-
162
- /** Convert PluginParamDef[] to a JSON Schema + ConfigUiHints for ConfigRenderer. */
163
- export function paramsToSchema(
164
- params: PluginParamDef[],
165
- pluginId: string,
166
- ): {
167
- schema: JsonSchemaObject;
168
- hints: Record<string, ConfigUiHint>;
169
- } {
170
- const properties: Record<string, Record<string, unknown>> = {};
171
- const required: string[] = [];
172
- const hints: Record<string, ConfigUiHint> = {};
173
-
174
- for (const p of params) {
175
- // Build JSON Schema property
176
- const prop: Record<string, unknown> = {};
177
- if (p.type === "boolean") {
178
- prop.type = "boolean";
179
- } else if (p.type === "number") {
180
- prop.type = "number";
181
- } else {
182
- prop.type = "string";
183
- }
184
- if (p.description) prop.description = p.description;
185
- if (p.default != null) prop.default = p.default;
186
- if (p.options?.length) {
187
- prop.enum = p.options;
188
- }
189
-
190
- // Auto-detect format from key name
191
- const keyUpper = p.key.toUpperCase();
192
- if (
193
- keyUpper.includes("URL") ||
194
- keyUpper.includes("ENDPOINT") ||
195
- keyUpper.includes("BASE_URL")
196
- ) {
197
- prop.format = "uri";
198
- } else if (keyUpper.includes("EMAIL")) {
199
- prop.format = "email";
200
- } else if (
201
- keyUpper.includes("_DATE") ||
202
- keyUpper.includes("_SINCE") ||
203
- keyUpper.includes("_UNTIL")
204
- ) {
205
- prop.format = "date";
206
- }
207
-
208
- // Auto-detect number types from key patterns
209
- if (keyUpper.includes("PORT") && prop.type === "string") {
210
- prop.type = "number";
211
- } else if (
212
- (keyUpper.includes("TIMEOUT") ||
213
- keyUpper.includes("INTERVAL") ||
214
- keyUpper.includes("_MS")) &&
215
- prop.type === "string"
216
- ) {
217
- prop.type = "number";
218
- } else if (
219
- (keyUpper.includes("COUNT") ||
220
- keyUpper.includes("LIMIT") ||
221
- keyUpper.startsWith("MAX_")) &&
222
- prop.type === "string"
223
- ) {
224
- prop.type = "number";
225
- } else if (
226
- (keyUpper.includes("RETRY") || keyUpper.includes("RETRIES")) &&
227
- prop.type === "string"
228
- ) {
229
- prop.type = "number";
230
- }
231
-
232
- // Auto-detect boolean from key patterns
233
- if (
234
- prop.type === "string" &&
235
- (keyUpper.includes("SHOULD_") ||
236
- keyUpper.endsWith("_ENABLED") ||
237
- keyUpper.endsWith("_DISABLED") ||
238
- keyUpper.startsWith("USE_") ||
239
- keyUpper.startsWith("ALLOW_") ||
240
- keyUpper.startsWith("IS_") ||
241
- keyUpper.startsWith("ENABLE_") ||
242
- keyUpper.startsWith("DISABLE_") ||
243
- keyUpper.startsWith("FORCE_") ||
244
- keyUpper.endsWith("_AUTONOMOUS_MODE"))
245
- ) {
246
- prop.type = "boolean";
247
- }
248
-
249
- // Auto-detect number from key patterns (RATE, DELAY, THRESHOLD, SIZE, TEMPERATURE)
250
- if (
251
- prop.type === "string" &&
252
- (keyUpper.includes("_RATE") ||
253
- keyUpper.includes("DELAY") ||
254
- keyUpper.includes("THRESHOLD") ||
255
- keyUpper.includes("_SIZE") ||
256
- keyUpper.includes("TEMPERATURE") ||
257
- keyUpper.includes("_DEPTH") ||
258
- keyUpper.includes("_PERCENT") ||
259
- keyUpper.includes("_RATIO"))
260
- ) {
261
- prop.type = "number";
262
- }
263
-
264
- // Auto-detect comma-separated lists → array renderer
265
- if (prop.type === "string" && !prop.enum) {
266
- const descLower = (p.description || "").toLowerCase();
267
- const isCommaSep =
268
- descLower.includes("comma-separated") ||
269
- descLower.includes("comma separated");
270
- const isListSuffix =
271
- keyUpper.endsWith("_IDS") ||
272
- keyUpper.endsWith("_CHANNELS") ||
273
- keyUpper.endsWith("_ROOMS") ||
274
- keyUpper.endsWith("_RELAYS") ||
275
- keyUpper.endsWith("_FEEDS") ||
276
- keyUpper.endsWith("_DEXES") ||
277
- keyUpper.endsWith("_WHITELIST") ||
278
- keyUpper.endsWith("_BLACKLIST") ||
279
- keyUpper.endsWith("_ALLOWLIST") ||
280
- keyUpper.endsWith("_SPACES") ||
281
- keyUpper.endsWith("_THREADS") ||
282
- keyUpper.endsWith("_ROLES") ||
283
- keyUpper.endsWith("_TENANTS") ||
284
- keyUpper.endsWith("_DIRS");
285
- if (isCommaSep || isListSuffix) {
286
- prop.type = "array";
287
- prop.items = { type: "string" };
288
- }
289
- }
290
-
291
- // Auto-detect textarea (prompts, instructions, templates, greetings)
292
- if (prop.type === "string" && !prop.enum && !keyUpper.includes("MODEL")) {
293
- if (
294
- keyUpper.includes("INSTRUCTIONS") ||
295
- keyUpper.includes("_GREETING") ||
296
- keyUpper.endsWith("_PROMPT") ||
297
- keyUpper.endsWith("_TEMPLATE") ||
298
- keyUpper.includes("SYSTEM_MESSAGE")
299
- ) {
300
- prop.maxLength = 999;
301
- }
302
- }
303
-
304
- // Auto-detect JSON fields (json-encoded or serialized values)
305
- if (prop.type === "string" && !p.sensitive) {
306
- const descLower = (p.description || "").toLowerCase();
307
- if (
308
- descLower.includes("json-encoded") ||
309
- descLower.includes("json array") ||
310
- descLower.includes("serialized") ||
311
- descLower.includes("json format")
312
- ) {
313
- (prop as Record<string, unknown>).__jsonHint = true;
314
- }
315
- }
316
-
317
- // Auto-detect file/directory paths → file renderer
318
- if (prop.type === "string") {
319
- if (
320
- (keyUpper.endsWith("_PATH") && !keyUpper.includes("WEBHOOK")) ||
321
- keyUpper.endsWith("_DIR") ||
322
- keyUpper.endsWith("_DIRECTORY") ||
323
- keyUpper.endsWith("_FOLDER") ||
324
- keyUpper.endsWith("_FILE")
325
- ) {
326
- (prop as Record<string, unknown>).__fileHint = true;
327
- }
328
- }
329
-
330
- // Auto-detect textarea from long descriptions
331
- if (p.description && p.description.length > 200) {
332
- prop.maxLength = 999;
333
- }
334
-
335
- properties[p.key] = prop;
336
-
337
- if (p.required) required.push(p.key);
338
-
339
- // Build UI hint
340
- const hint: ConfigUiHint = {
341
- label: autoLabel(p.key, pluginId),
342
- sensitive: p.sensitive ?? false,
343
- advanced: isAdvancedParam(p),
344
- };
345
-
346
- // Port numbers — constrain range
347
- if (keyUpper.includes("PORT")) {
348
- hint.min = 1;
349
- hint.max = 65535;
350
- prop.minimum = 1;
351
- prop.maximum = 65535;
352
- }
353
-
354
- // Timeout/interval — show unit
355
- if (
356
- keyUpper.includes("TIMEOUT") ||
357
- keyUpper.includes("INTERVAL") ||
358
- keyUpper.includes("_MS")
359
- ) {
360
- hint.unit = "ms";
361
- prop.minimum = 0;
362
- hint.min = 0;
363
- }
364
-
365
- // Count/limit — non-negative
366
- if (
367
- keyUpper.includes("COUNT") ||
368
- keyUpper.includes("LIMIT") ||
369
- keyUpper.startsWith("MAX_")
370
- ) {
371
- hint.min = 0;
372
- prop.minimum = 0;
373
- }
374
-
375
- // Retry — bounded range
376
- if (keyUpper.includes("RETRY") || keyUpper.includes("RETRIES")) {
377
- hint.min = 0;
378
- hint.max = 100;
379
- prop.minimum = 0;
380
- prop.maximum = 100;
381
- }
382
-
383
- // Debug/verbose/enabled — mark as advanced
384
- if (
385
- keyUpper.includes("DEBUG") ||
386
- keyUpper.includes("VERBOSE") ||
387
- keyUpper.includes("ENABLED")
388
- ) {
389
- hint.advanced = true;
390
- }
391
-
392
- // Model selection — NOT advanced (important user-facing choice)
393
- if (keyUpper.includes("MODEL") && p.options?.length) {
394
- hint.advanced = false;
395
- }
396
-
397
- // Region/zone — suggest common cloud regions when no options provided
398
- if (
399
- (keyUpper.includes("REGION") || keyUpper.includes("ZONE")) &&
400
- !p.options?.length
401
- ) {
402
- hint.type = "select";
403
- hint.options = [
404
- { value: "us-east-1", label: "US East (N. Virginia)" },
405
- { value: "us-west-2", label: "US West (Oregon)" },
406
- { value: "eu-west-1", label: "EU (Ireland)" },
407
- { value: "eu-central-1", label: "EU (Frankfurt)" },
408
- { value: "ap-southeast-1", label: "Asia Pacific (Singapore)" },
409
- { value: "ap-northeast-1", label: "Asia Pacific (Tokyo)" },
410
- ];
411
- }
412
-
413
- // File/directory path → file renderer
414
- if ((prop as Record<string, unknown>).__fileHint) {
415
- hint.type = "file";
416
- delete (prop as Record<string, unknown>).__fileHint;
417
- }
418
-
419
- // JSON-encoded value → json renderer
420
- if ((prop as Record<string, unknown>).__jsonHint) {
421
- hint.type = "json";
422
- delete (prop as Record<string, unknown>).__jsonHint;
423
- }
424
-
425
- // Model name fields — helpful placeholder (overridden by server-provided model options via configUiHints)
426
- if (
427
- keyUpper.includes("MODEL") &&
428
- prop.type === "string" &&
429
- !p.options?.length
430
- ) {
431
- if (!hint.placeholder) {
432
- if (keyUpper.includes("EMBEDDING")) {
433
- hint.placeholder = "e.g., text-embedding-3-small";
434
- } else if (keyUpper.includes("TTS")) {
435
- hint.placeholder = "e.g., tts-1, eleven_multilingual_v2";
436
- } else if (keyUpper.includes("STT")) {
437
- hint.placeholder = "e.g., whisper-1";
438
- } else if (keyUpper.includes("IMAGE")) {
439
- hint.placeholder = "e.g., dall-e-3, gpt-4o";
440
- } else {
441
- hint.placeholder = "e.g., gpt-4o, claude-sonnet-4-20250514";
442
- }
443
- }
444
- }
445
-
446
- // Mode/strategy fields — extract options from description if available
447
- if (
448
- prop.type === "string" &&
449
- !prop.enum &&
450
- !p.sensitive &&
451
- (keyUpper.endsWith("_MODE") || keyUpper.endsWith("_STRATEGY"))
452
- ) {
453
- const desc = p.description ?? "";
454
- // Match "auto | local | mcp" or "filesystem|in-context|sqlite"
455
- const pipeMatch =
456
- desc.match(/:\s*([a-z0-9_-]+(?:\s*[|/]\s*[a-z0-9_-]+)+)/i) ??
457
- desc.match(/\(([a-z0-9_-]+(?:\s*[|/,]\s*[a-z0-9_-]+)+)\)/i);
458
- if (pipeMatch) {
459
- const opts = pipeMatch[1]
460
- .split(/[|/,]/)
461
- .map((s) => s.trim())
462
- .filter(Boolean);
463
- const safeOpts = opts.filter((v) => /^[a-z0-9_-]+$/i.test(v));
464
- if (safeOpts.length >= 2 && safeOpts.length <= 10) {
465
- hint.type = "select";
466
- hint.options = safeOpts.map((v) => ({ value: v, label: v }));
467
- }
468
- } else {
469
- // Match 'polling' or 'webhook' -or- 'env', 'oauth', or 'bearer' style
470
- const quotedOpts = [...desc.matchAll(/'([a-z0-9_-]+)'/gi)].map(
471
- (m) => m[1],
472
- );
473
- const safeQuoted = quotedOpts.filter((v) => /^[a-z0-9_-]+$/i.test(v));
474
- if (safeQuoted.length >= 2 && safeQuoted.length <= 10) {
475
- // Radio for 2 options, select for 3+
476
- hint.type = safeQuoted.length === 2 ? "radio" : "select";
477
- hint.options = safeQuoted.map((v) => ({ value: v, label: v }));
478
- }
479
- }
480
- }
481
-
482
- if (p.description) {
483
- hint.help = p.description;
484
- if (p.default != null) hint.help += ` (default: ${String(p.default)})`;
485
- }
486
- if (p.sensitive)
487
- hint.placeholder = p.isSet ? "******** (already set)" : "Enter value...";
488
- else if (p.default) hint.placeholder = `Default: ${String(p.default)}`;
489
- hints[p.key] = hint;
490
- }
491
-
492
- return {
493
- schema: { type: "object", properties, required } as JsonSchemaObject,
494
- hints,
495
- };
496
- }
497
-
498
- /* ── PluginConfigForm bridge ─────────────────────────────────────────── */
499
-
500
- function PluginConfigForm({
501
- plugin,
502
- pluginConfigs,
503
- onParamChange,
504
- }: {
505
- plugin: PluginInfo;
506
- pluginConfigs: Record<string, Record<string, string>>;
507
- onParamChange: (pluginId: string, paramKey: string, value: string) => void;
508
- }) {
509
- const params = plugin.parameters ?? [];
510
- const { schema, hints: autoHints } = useMemo(
511
- () => paramsToSchema(params, plugin.id),
512
- [params, plugin.id],
513
- );
514
-
515
- // Merge server-provided configUiHints over auto-generated hints.
516
- // Server hints take priority (override auto-generated ones).
517
- const hints = useMemo(() => {
518
- const serverHints = plugin.configUiHints;
519
- if (!serverHints || Object.keys(serverHints).length === 0) return autoHints;
520
- const merged: Record<string, ConfigUiHint> = { ...autoHints };
521
- for (const [key, serverHint] of Object.entries(serverHints)) {
522
- merged[key] = { ...merged[key], ...serverHint };
523
- }
524
- return merged;
525
- }, [autoHints, plugin.configUiHints]);
526
-
527
- // Build values from current config state + existing server values.
528
- // Array-typed fields need comma-separated strings parsed into arrays.
529
- const values = useMemo(() => {
530
- const v: Record<string, unknown> = {};
531
- const props = (schema.properties ?? {}) as Record<
532
- string,
533
- Record<string, unknown>
534
- >;
535
- for (const p of params) {
536
- const isArrayField = props[p.key]?.type === "array";
537
- const configValue = pluginConfigs[plugin.id]?.[p.key];
538
- if (configValue !== undefined) {
539
- if (isArrayField && typeof configValue === "string") {
540
- v[p.key] = configValue
541
- ? configValue
542
- .split(",")
543
- .map((s: string) => s.trim())
544
- .filter(Boolean)
545
- : [];
546
- } else {
547
- v[p.key] = configValue;
548
- }
549
- } else if (p.isSet && !p.sensitive && p.currentValue != null) {
550
- if (isArrayField && typeof p.currentValue === "string") {
551
- v[p.key] = String(p.currentValue)
552
- ? String(p.currentValue)
553
- .split(",")
554
- .map((s: string) => s.trim())
555
- .filter(Boolean)
556
- : [];
557
- } else {
558
- v[p.key] = p.currentValue;
559
- }
560
- }
561
- }
562
- return v;
563
- }, [params, plugin.id, pluginConfigs, schema]);
564
-
565
- const setKeys = useMemo(
566
- () =>
567
- new Set(
568
- params
569
- .filter((p: PluginParamDef) => p.isSet)
570
- .map((p: PluginParamDef) => p.key),
571
- ),
572
- [params],
573
- );
574
-
575
- const handleChange = useCallback(
576
- (key: string, value: unknown) => {
577
- // Join array values back to comma-separated strings for env var storage
578
- const stringValue = Array.isArray(value)
579
- ? value.join(", ")
580
- : String(value ?? "");
581
- onParamChange(plugin.id, key, stringValue);
582
- },
583
- [plugin.id, onParamChange],
584
- );
585
-
586
- return (
587
- <ConfigRenderer
588
- schema={schema}
589
- hints={hints}
590
- values={values}
591
- setKeys={setKeys}
592
- registry={defaultRegistry}
593
- pluginId={plugin.id}
594
- onChange={handleChange}
595
- />
596
- );
597
- }
598
-
599
- /* ── Default Icons ─────────────────────────────────────────────────── */
600
-
601
- const DEFAULT_ICONS: Record<string, LucideIcon> = {
602
- // AI Providers
603
- anthropic: Brain,
604
- "google-genai": Sparkles,
605
- groq: Zap,
606
- "local-ai": Monitor,
607
- ollama: Bot,
608
- openai: CircleDashed,
609
- openrouter: Shuffle,
610
- "vercel-ai-gateway": Triangle,
611
- xai: Hash,
612
- // Connectors — chat & social
613
- discord: MessageCircle,
614
- telegram: Send,
615
- slack: Briefcase,
616
- twitter: Twitter,
617
- whatsapp: Smartphone,
618
- signal: Lock,
619
- imessage: MessageSquare,
620
- bluebubbles: Droplets,
621
- bluesky: Leaf,
622
- farcaster: Circle,
623
- instagram: Video,
624
- nostr: Fingerprint,
625
- twitch: Gamepad2,
626
- matrix: Link,
627
- mattermost: Diamond,
628
- msteams: Square,
629
- "google-chat": MessagesSquare,
630
- feishu: Feather,
631
- line: Circle,
632
- "nextcloud-talk": Cloud,
633
- tlon: Tornado,
634
- zalo: Circle,
635
- zalouser: Circle,
636
- // Features — voice & audio
637
- "edge-tts": Volume2,
638
- elevenlabs: Mic,
639
- tts: Volume2,
640
- "simple-voice": Mic,
641
- "robot-voice": Bot,
642
- // Features — blockchain & finance
643
- evm: Link,
644
- solana: CircleDot,
645
- "auto-trader": TrendingDown,
646
- "lp-manager": Wallet,
647
- "social-alpha": Layers,
648
- polymarket: Gamepad2,
649
- x402: CreditCard,
650
- trust: Handshake,
651
- iq: Puzzle,
652
- // Features — dev tools & infra
653
- cli: Hash,
654
- code: Puzzle,
655
- shell: Shell,
656
- github: Github,
657
- linear: Square,
658
- mcp: Puzzle,
659
- browser: Chrome,
660
- computeruse: MousePointer2,
661
- n8n: Settings,
662
- webhooks: Webhook,
663
- // Features — knowledge & memory
664
- knowledge: BookOpen,
665
- memory: Dna,
666
- "local-embedding": Binary,
667
- pdf: FileText,
668
- "secrets-manager": FileKey,
669
- scratchpad: StickyNote,
670
- rlm: RefreshCw,
671
- // Features — agents & orchestration
672
- "agent-orchestrator": Target,
673
- "agent-skills": Wrench,
674
- "plugin-manager": Package,
675
- "copilot-proxy": Handshake,
676
- directives: ClipboardList,
677
- goals: Target,
678
- "eliza-classic": Bot,
679
- // Features — media & content
680
- vision: Eye,
681
- rss: Rss,
682
- "gmail-watch": Mail,
683
- prose: PenTool,
684
- form: ClipboardList,
685
- // Features — scheduling & automation
686
- cron: Clock,
687
- scheduling: Calendar,
688
- todo: ClipboardList,
689
- commands: Command,
690
- // Features — storage & logging
691
- "s3-storage": Server,
692
- "trajectory-logger": TrendingDown,
693
- experience: Star,
694
- // Features — gaming & misc
695
- minecraft: Pickaxe,
696
- roblox: BrickWall,
697
- babylon: Gamepad,
698
- mysticism: Sparkle,
699
- personality: Target,
700
- moltbook: ScrollText,
701
- tee: LockKeyhole,
702
- blooio: Circle,
703
- acp: Construction,
704
- elizacloud: Cloud,
705
- twilio: Phone,
706
- };
707
-
708
- /** Resolve display icon: explicit plugin.icon, fallback to default map, or null. */
709
- function resolveIcon(p: PluginInfo): LucideIcon | string | null {
710
- if (p.icon) return p.icon;
711
- return DEFAULT_ICONS[p.id] ?? null;
712
- }
713
-
714
- function iconImageSource(icon: string): string | null {
715
- const value = icon.trim();
716
- if (!value) return null;
717
- if (
718
- /^(https?:|data:image\/|blob:|file:|capacitor:|electrobun:|app:|\/|\.\/|\.\.\/)/i.test(
719
- value,
720
- )
721
- ) {
722
- return resolveAppAssetUrl(value);
723
- }
724
- return null;
725
- }
726
-
727
- function getPluginResourceLinks(
728
- plugin: Pick<PluginInfo, "setupGuideUrl" | "homepage" | "repository">,
729
- ): Array<{ key: string; label: string; url: string }> {
730
- const seen = new Set<string>();
731
- const ordered = [
732
- { key: "guide", label: "Setup guide", url: plugin.setupGuideUrl },
733
- { key: "official", label: "Official", url: plugin.homepage },
734
- { key: "source", label: "Source", url: plugin.repository },
735
- ];
736
- return ordered.flatMap((item) => {
737
- const url = item.url?.trim();
738
- if (!url || seen.has(url)) return [];
739
- seen.add(url);
740
- return [{ key: item.key, label: item.label, url }];
741
- });
742
- }
743
-
744
- /* ── Sub-group Classification ──────────────────────────────────────── */
745
-
746
- /** Map plugin IDs to fine-grained sub-groups for the "Feature" category. */
747
- const FEATURE_SUBGROUP: Record<string, string> = {
748
- // Voice & Audio
749
- "edge-tts": "voice",
750
- elevenlabs: "voice",
751
- tts: "voice",
752
- "simple-voice": "voice",
753
- "robot-voice": "voice",
754
- // Blockchain & Finance
755
- evm: "blockchain",
756
- solana: "blockchain",
757
- "auto-trader": "blockchain",
758
- "lp-manager": "blockchain",
759
- "social-alpha": "blockchain",
760
- polymarket: "blockchain",
761
- x402: "blockchain",
762
- trust: "blockchain",
763
- iq: "blockchain",
764
- // Dev Tools & Infrastructure
765
- cli: "devtools",
766
- code: "devtools",
767
- shell: "devtools",
768
- github: "devtools",
769
- linear: "devtools",
770
- mcp: "devtools",
771
- browser: "devtools",
772
- computeruse: "devtools",
773
- n8n: "devtools",
774
- webhooks: "devtools",
775
- // Knowledge & Memory
776
- knowledge: "knowledge",
777
- memory: "knowledge",
778
- "local-embedding": "knowledge",
779
- pdf: "knowledge",
780
- "secrets-manager": "knowledge",
781
- scratchpad: "knowledge",
782
- rlm: "knowledge",
783
- // Agents & Orchestration
784
- "agent-orchestrator": "agents",
785
- "agent-skills": "agents",
786
- "plugin-manager": "agents",
787
- "copilot-proxy": "agents",
788
- directives: "agents",
789
- goals: "agents",
790
- "eliza-classic": "agents",
791
- // Media & Content
792
- vision: "media",
793
- rss: "media",
794
- "gmail-watch": "media",
795
- prose: "media",
796
- form: "media",
797
- // Scheduling & Automation
798
- cron: "automation",
799
- scheduling: "automation",
800
- todo: "automation",
801
- commands: "automation",
802
- // Storage & Logging
803
- "s3-storage": "storage",
804
- "trajectory-logger": "storage",
805
- experience: "storage",
806
- // Gaming & Creative
807
- minecraft: "gaming",
808
- roblox: "gaming",
809
- babylon: "gaming",
810
- mysticism: "gaming",
811
- personality: "gaming",
812
- moltbook: "gaming",
813
- };
814
-
815
- const SUBGROUP_DISPLAY_ORDER = [
816
- "ai-provider",
817
- "connector",
818
- "streaming",
819
- "voice",
820
- "blockchain",
821
- "devtools",
822
- "knowledge",
823
- "agents",
824
- "media",
825
- "automation",
826
- "storage",
827
- "gaming",
828
- "feature-other",
829
- "showcase",
830
- ] as const;
831
-
832
- const SUBGROUP_LABELS: Record<string, string> = {
833
- "ai-provider": "AI Providers",
834
- connector: "Connectors",
835
- voice: "Voice & Audio",
836
- blockchain: "Blockchain & Finance",
837
- devtools: "Dev Tools & Infrastructure",
838
- knowledge: "Knowledge & Memory",
839
- agents: "Agents & Orchestration",
840
- media: "Media & Content",
841
- automation: "Scheduling & Automation",
842
- storage: "Storage & Logging",
843
- gaming: "Gaming & Creative",
844
- "feature-other": "Other Features",
845
- streaming: "Streaming Destinations",
846
- showcase: "Showcase",
847
- };
848
-
849
- const SUBGROUP_NAV_ICONS: Record<string, LucideIcon> = {
850
- all: Package,
851
- "ai-provider": Brain,
852
- connector: MessageCircle,
853
- streaming: Video,
854
- voice: Mic,
855
- blockchain: Wallet,
856
- devtools: Shell,
857
- knowledge: BookOpen,
858
- agents: Target,
859
- media: Eye,
860
- automation: Calendar,
861
- storage: Server,
862
- gaming: Gamepad2,
863
- "feature-other": Puzzle,
864
- showcase: Sparkles,
865
- };
866
-
867
- function subgroupForPlugin(plugin: PluginInfo): string {
868
- if (plugin.id === "__ui-showcase__") return "showcase";
869
- if (plugin.category === "ai-provider") return "ai-provider";
870
- if (plugin.category === "connector") return "connector";
871
- if (plugin.category === "streaming") return "streaming";
872
- return FEATURE_SUBGROUP[plugin.id] ?? "feature-other";
873
- }
874
-
875
- type StatusFilter = "all" | "enabled" | "disabled";
876
- type PluginsViewMode = "all" | "connectors" | "streaming" | "social";
877
- type SubgroupTag = { id: string; label: string; count: number };
878
-
879
- function comparePlugins(left: PluginInfo, right: PluginInfo): number {
880
- if (left.enabled !== right.enabled) return left.enabled ? -1 : 1;
881
- if (left.enabled && right.enabled) {
882
- const leftNeedsConfig =
883
- left.parameters?.some(
884
- (param: PluginParamDef) => param.required && !param.isSet,
885
- ) ?? false;
886
- const rightNeedsConfig =
887
- right.parameters?.some(
888
- (param: PluginParamDef) => param.required && !param.isSet,
889
- ) ?? false;
890
- if (leftNeedsConfig !== rightNeedsConfig) {
891
- return leftNeedsConfig ? -1 : 1;
892
- }
893
- }
894
- return (left.name ?? "").localeCompare(right.name ?? "");
895
- }
896
-
897
- function matchesPluginFilters(
898
- plugin: PluginInfo,
899
- searchLower: string,
900
- statusFilter: StatusFilter,
901
- ): boolean {
902
- const matchesStatus =
903
- statusFilter === "all" ||
904
- (statusFilter === "enabled" && plugin.enabled) ||
905
- (statusFilter === "disabled" && !plugin.enabled);
906
- const matchesSearch =
907
- !searchLower ||
908
- (plugin.name ?? "").toLowerCase().includes(searchLower) ||
909
- (plugin.description ?? "").toLowerCase().includes(searchLower) ||
910
- (plugin.tags ?? []).some((tag) =>
911
- (tag ?? "").toLowerCase().includes(searchLower),
912
- ) ||
913
- plugin.id.toLowerCase().includes(searchLower);
914
- return matchesStatus && matchesSearch;
915
- }
916
-
917
- function sortPlugins(
918
- filteredPlugins: PluginInfo[],
919
- pluginOrder: string[],
920
- allowCustomOrder: boolean,
921
- ): PluginInfo[] {
922
- if (!allowCustomOrder || pluginOrder.length === 0) {
923
- return [...filteredPlugins].sort(comparePlugins);
924
- }
925
-
926
- const orderMap = new Map(pluginOrder.map((id, index) => [id, index]));
927
- return [...filteredPlugins].sort((left, right) => {
928
- const leftIndex = orderMap.get(left.id);
929
- const rightIndex = orderMap.get(right.id);
930
- if (leftIndex != null && rightIndex != null) return leftIndex - rightIndex;
931
- if (leftIndex != null) return -1;
932
- if (rightIndex != null) return 1;
933
- return comparePlugins(left, right);
934
- });
935
- }
936
-
937
- function buildPluginListState(options: {
938
- allowCustomOrder: boolean;
939
- effectiveSearch: string;
940
- effectiveStatusFilter: StatusFilter;
941
- isConnectorLikeMode: boolean;
942
- mode: PluginsViewMode;
943
- pluginOrder: string[];
944
- plugins: PluginInfo[];
945
- showSubgroupFilters: boolean;
946
- subgroupFilter: string;
947
- }): {
948
- categoryPlugins: PluginInfo[];
949
- enabledCount: number;
950
- nonDbPlugins: PluginInfo[];
951
- sorted: PluginInfo[];
952
- subgroupTags: SubgroupTag[];
953
- visiblePlugins: PluginInfo[];
954
- } {
955
- const {
956
- allowCustomOrder,
957
- effectiveSearch,
958
- effectiveStatusFilter,
959
- isConnectorLikeMode,
960
- mode,
961
- pluginOrder,
962
- plugins,
963
- showSubgroupFilters,
964
- subgroupFilter,
965
- } = options;
966
- const categoryPlugins = plugins.filter(
967
- (plugin) =>
968
- plugin.category !== "database" &&
969
- !ALWAYS_ON_PLUGIN_IDS.has(plugin.id) &&
970
- (!isConnectorLikeMode || plugin.category === "connector") &&
971
- (mode !== "streaming" || plugin.category === "streaming"),
972
- );
973
- const nonDbPlugins = [SHOWCASE_PLUGIN, ...categoryPlugins];
974
- const searchLower = effectiveSearch.toLowerCase();
975
- const sorted = sortPlugins(
976
- categoryPlugins.filter((plugin) =>
977
- matchesPluginFilters(plugin, searchLower, effectiveStatusFilter),
978
- ),
979
- pluginOrder,
980
- allowCustomOrder,
981
- );
982
- const enabledCount = categoryPlugins.filter(
983
- (plugin) => plugin.enabled,
984
- ).length;
985
-
986
- const subgroupCounts: Record<string, number> = {};
987
- const visiblePlugins: PluginInfo[] = [];
988
- for (const plugin of sorted) {
989
- const subgroup = subgroupForPlugin(plugin);
990
- subgroupCounts[subgroup] = (subgroupCounts[subgroup] ?? 0) + 1;
991
- if (
992
- !showSubgroupFilters ||
993
- subgroupFilter === "all" ||
994
- subgroup === subgroupFilter
995
- ) {
996
- visiblePlugins.push(plugin);
997
- }
998
- }
999
-
1000
- const subgroupTags = [
1001
- { id: "all", label: "All", count: sorted.length },
1002
- ...SUBGROUP_DISPLAY_ORDER.filter(
1003
- (subgroupId) => (subgroupCounts[subgroupId] ?? 0) > 0,
1004
- ).map((subgroupId) => ({
1005
- id: subgroupId,
1006
- label: SUBGROUP_LABELS[subgroupId],
1007
- count: subgroupCounts[subgroupId] ?? 0,
1008
- })),
1009
- ];
1010
-
1011
- return {
1012
- categoryPlugins,
1013
- enabledCount,
1014
- nonDbPlugins,
1015
- sorted,
1016
- subgroupTags,
1017
- visiblePlugins,
1018
- };
1019
- }
1020
-
1021
- /* ── Shared PluginListView ─────────────────────────────────────────── */
1022
-
1023
- interface PluginListViewProps {
1024
- /** Label used in search placeholder and empty state messages. */
1025
- label: string;
1026
- /** Optional list mode for pre-filtered views like Connectors. */
1027
- mode?: PluginsViewMode;
1028
- /** Whether the view is rendered in a full-screen gamified modal. */
1029
- inModal?: boolean;
1030
- }
1031
-
1032
- function PluginListView({ label, mode = "all", inModal }: PluginListViewProps) {
1033
- const {
1034
- plugins,
1035
- pluginStatusFilter,
1036
- pluginSearch,
1037
- pluginSettingsOpen,
1038
- pluginSaving,
1039
- pluginSaveSuccess,
1040
- loadPlugins,
1041
- handlePluginToggle,
1042
- handlePluginConfigSave,
1043
- setActionNotice,
1044
- setState,
1045
- t,
1046
- } = useApp();
1047
-
1048
- const [pluginConfigs, setPluginConfigs] = useState<
1049
- Record<string, Record<string, string>>
1050
- >({});
1051
- const [testResults, setTestResults] = useState<
1052
- Map<
1053
- string,
1054
- {
1055
- success: boolean;
1056
- message?: string;
1057
- error?: string;
1058
- durationMs: number;
1059
- loading: boolean;
1060
- }
1061
- >
1062
- >(new Map());
1063
- const [addDirOpen, setAddDirOpen] = useState(false);
1064
- const [addDirPath, setAddDirPath] = useState("");
1065
- const [addDirLoading, setAddDirLoading] = useState(false);
1066
- const [installingPlugins, setInstallingPlugins] = useState<Set<string>>(
1067
- new Set(),
1068
- );
1069
- const [installProgress, setInstallProgress] = useState<
1070
- Map<string, { phase: string; message: string }>
1071
- >(new Map());
1072
- const [togglingPlugins, setTogglingPlugins] = useState<Set<string>>(
1073
- new Set(),
1074
- );
1075
- const hasPluginToggleInFlight = togglingPlugins.size > 0;
1076
-
1077
- // ── Drag-to-reorder state ────────────────────────────────────────
1078
- const [pluginOrder, setPluginOrder] = useState<string[]>(() => {
1079
- try {
1080
- const stored = localStorage.getItem("pluginOrder");
1081
- return stored ? JSON.parse(stored) : [];
1082
- } catch {
1083
- return [];
1084
- }
1085
- });
1086
- const [draggingId, setDraggingId] = useState<string | null>(null);
1087
- const [dragOverId, setDragOverId] = useState<string | null>(null);
1088
- const dragRef = useRef<string | null>(null);
1089
- const isSocialMode = mode === "social";
1090
- const isConnectorLikeMode = mode === "connectors" || mode === "social";
1091
- const resultLabel = isSocialMode ? "connectors" : label.toLowerCase();
1092
- const searchPlaceholder = isSocialMode
1093
- ? "Search..."
1094
- : `Search ${label.toLowerCase()}...`;
1095
- const effectiveStatusFilter: StatusFilter =
1096
- isSocialMode && pluginStatusFilter === "disabled"
1097
- ? "all"
1098
- : pluginStatusFilter;
1099
- const effectiveSearch = pluginSearch;
1100
- const showToolbar = true;
1101
- const allowCustomOrder = !isSocialMode;
1102
- const showPluginManagementActions = !isSocialMode;
1103
-
1104
- // Load plugins on mount
1105
- useEffect(() => {
1106
- void loadPlugins();
1107
- }, [loadPlugins]);
1108
-
1109
- // Listen for install progress events via WebSocket
1110
- useEffect(() => {
1111
- const unbind = client.onWsEvent(
1112
- "install-progress",
1113
- (data: Record<string, unknown>) => {
1114
- const pluginName = data.pluginName as string;
1115
- const phase = data.phase as string;
1116
- const message = data.message as string;
1117
- if (!pluginName) return;
1118
- if (phase === "complete" || phase === "error") {
1119
- setInstallProgress((prev) => {
1120
- const next = new Map(prev);
1121
- next.delete(pluginName);
1122
- return next;
1123
- });
1124
- } else {
1125
- setInstallProgress((prev) =>
1126
- new Map(prev).set(pluginName, { phase, message }),
1127
- );
1128
- }
1129
- },
1130
- );
1131
- return unbind;
1132
- }, []);
1133
-
1134
- // Persist custom order
1135
- useEffect(() => {
1136
- if (pluginOrder.length > 0) {
1137
- localStorage.setItem("pluginOrder", JSON.stringify(pluginOrder));
1138
- }
1139
- }, [pluginOrder]);
1140
-
1141
- const [subgroupFilter, setSubgroupFilter] = useState<string>("all");
1142
- const showSubgroupFilters =
1143
- mode !== "connectors" && mode !== "streaming" && mode !== "social";
1144
- const showDesktopSubgroupSidebar = showSubgroupFilters;
1145
- const {
1146
- categoryPlugins,
1147
- enabledCount,
1148
- nonDbPlugins,
1149
- sorted,
1150
- subgroupTags,
1151
- visiblePlugins,
1152
- } = useMemo(
1153
- () =>
1154
- buildPluginListState({
1155
- allowCustomOrder,
1156
- effectiveSearch,
1157
- effectiveStatusFilter,
1158
- isConnectorLikeMode,
1159
- mode,
1160
- pluginOrder,
1161
- plugins,
1162
- showSubgroupFilters,
1163
- subgroupFilter,
1164
- }),
1165
- [
1166
- allowCustomOrder,
1167
- effectiveSearch,
1168
- effectiveStatusFilter,
1169
- isConnectorLikeMode,
1170
- mode,
1171
- pluginOrder,
1172
- plugins,
1173
- showSubgroupFilters,
1174
- subgroupFilter,
1175
- ],
1176
- );
1177
-
1178
- useEffect(() => {
1179
- if (!showSubgroupFilters) return;
1180
- if (subgroupFilter === "all") return;
1181
- if (!subgroupTags.some((tag) => tag.id === subgroupFilter)) {
1182
- setSubgroupFilter("all");
1183
- }
1184
- }, [showSubgroupFilters, subgroupFilter, subgroupTags]);
1185
-
1186
- const renderSubgroupFilterButton = useCallback(
1187
- (
1188
- tag: { id: string; label: string; count: number },
1189
- options?: { sidebar?: boolean },
1190
- ) => {
1191
- const isActive = subgroupFilter === tag.id;
1192
- if (options?.sidebar) {
1193
- const Icon = SUBGROUP_NAV_ICONS[tag.id] ?? Package;
1194
- return (
1195
- <button
1196
- key={tag.id}
1197
- type="button"
1198
- onClick={() => setSubgroupFilter(tag.id)}
1199
- aria-current={isActive ? "page" : undefined}
1200
- className={`flex w-full items-center gap-3 rounded-2xl border px-4 py-3 text-left transition-all duration-200 ${isActive
1201
- ? "border-accent/40 bg-accent/12 text-txt shadow-[0_10px_30px_rgba(var(--accent),0.08)]"
1202
- : "border-transparent text-muted hover:border-border/60 hover:bg-card/55 hover:text-txt"
1203
- }`}
1204
- >
1205
- <span
1206
- className={`flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border ${isActive
1207
- ? "border-accent/30 bg-accent/18 text-txt-strong"
1208
- : "border-border/50 bg-bg-accent/80 text-muted"
1209
- }`}
1210
- >
1211
- <Icon className="w-4 h-4" />
1212
- </span>
1213
- <span className="min-w-0 flex-1">
1214
- <span className="block text-sm font-semibold leading-snug text-current">
1215
- {tag.label}
1216
- </span>
1217
- </span>
1218
- <span
1219
- className={`rounded-full border px-2 py-0.5 text-[10px] font-mono leading-none ${isActive
1220
- ? "border-accent/20 bg-accent/20 text-txt"
1221
- : "border-border/50 bg-black/10 text-muted"
1222
- }`}
1223
- >
1224
- {tag.count}
1225
- </span>
1226
- </button>
1227
- );
1228
- }
1229
-
1230
- return (
1231
- <Button
1232
- key={tag.id}
1233
- variant={isActive ? "default" : "outline"}
1234
- size="sm"
1235
- className={`h-7 px-3 text-[11px] font-bold tracking-wide rounded-lg transition-all ${isActive
1236
- ? "shadow-[0_0_10px_rgba(var(--accent),0.2)] border-accent"
1237
- : "bg-card/40 backdrop-blur-sm border-border/40 text-muted hover:text-txt shadow-sm hover:border-accent/30"
1238
- }`}
1239
- onClick={() => setSubgroupFilter(tag.id)}
1240
- >
1241
- {tag.label}
1242
- <span
1243
- className={`ml-1.5 px-1.5 py-0.5 rounded border text-[9px] font-mono leading-none ${isActive ? "bg-black/20 border-black/10" : "bg-black/10 border-white/5"}`}
1244
- >
1245
- {tag.count}
1246
- </span>
1247
- </Button>
1248
- );
1249
- },
1250
- [subgroupFilter],
1251
- );
1252
-
1253
- // ── Handlers ───────────────────────────────────────────────────────
1254
-
1255
- const toggleSettings = (pluginId: string) => {
1256
- const next = new Set<string>();
1257
- if (!pluginSettingsOpen.has(pluginId)) next.add(pluginId);
1258
- setState("pluginSettingsOpen", next);
1259
- };
1260
-
1261
- const handleParamChange = (
1262
- pluginId: string,
1263
- paramKey: string,
1264
- value: string,
1265
- ) => {
1266
- setPluginConfigs((prev) => ({
1267
- ...prev,
1268
- [pluginId]: { ...prev[pluginId], [paramKey]: value },
1269
- }));
1270
- };
1271
-
1272
- const handleConfigSave = async (pluginId: string) => {
1273
- // Showcase plugin: no-op save (it's not a real plugin)
1274
- if (pluginId === "__ui-showcase__") return;
1275
- const config = pluginConfigs[pluginId] ?? {};
1276
- await handlePluginConfigSave(pluginId, config);
1277
- setPluginConfigs((prev) => {
1278
- const next = { ...prev };
1279
- delete next[pluginId];
1280
- return next;
1281
- });
1282
- };
1283
-
1284
- const handleConfigReset = (pluginId: string) => {
1285
- setPluginConfigs((prev) => {
1286
- const next = { ...prev };
1287
- delete next[pluginId];
1288
- return next;
1289
- });
1290
- };
1291
-
1292
- const handleTestConnection = async (pluginId: string) => {
1293
- setTestResults((prev) => {
1294
- const next = new Map(prev);
1295
- next.set(pluginId, { success: false, loading: true, durationMs: 0 });
1296
- return next;
1297
- });
1298
- try {
1299
- const result = await client.testPluginConnection(pluginId);
1300
- setTestResults((prev) => {
1301
- const next = new Map(prev);
1302
- next.set(pluginId, { ...result, loading: false });
1303
- return next;
1304
- });
1305
- } catch (err) {
1306
- setTestResults((prev) => {
1307
- const next = new Map(prev);
1308
- next.set(pluginId, {
1309
- success: false,
1310
- error: err instanceof Error ? err.message : String(err),
1311
- loading: false,
1312
- durationMs: 0,
1313
- });
1314
- return next;
1315
- });
1316
- }
1317
- };
1318
-
1319
- const handleInstallPlugin = async (pluginId: string, npmName: string) => {
1320
- setInstallingPlugins((prev) => new Set(prev).add(pluginId));
1321
- try {
1322
- await client.installRegistryPlugin(npmName);
1323
- await loadPlugins();
1324
- setActionNotice(
1325
- `${npmName} installed. Restart required to activate.`,
1326
- "success",
1327
- );
1328
- } catch (err) {
1329
- setActionNotice(
1330
- `Failed to install ${npmName}: ${err instanceof Error ? err.message : "unknown error"}`,
1331
- "error",
1332
- 3800,
1333
- );
1334
- // Still try to refresh in case install succeeded but restart failed
1335
- try {
1336
- await loadPlugins();
1337
- } catch {
1338
- /* ignore */
1339
- }
1340
- } finally {
1341
- setInstallingPlugins((prev) => {
1342
- const next = new Set(prev);
1343
- next.delete(pluginId);
1344
- return next;
1345
- });
1346
- }
1347
- };
1348
-
1349
- const handleTogglePlugin = useCallback(
1350
- async (pluginId: string, enabled: boolean) => {
1351
- let shouldStart = false;
1352
- setTogglingPlugins((prev) => {
1353
- if (prev.has(pluginId) || prev.size > 0) return prev;
1354
- shouldStart = true;
1355
- return new Set(prev).add(pluginId);
1356
- });
1357
- if (!shouldStart) return;
1358
-
1359
- try {
1360
- await handlePluginToggle(pluginId, enabled);
1361
- } finally {
1362
- setTogglingPlugins((prev) => {
1363
- const next = new Set(prev);
1364
- next.delete(pluginId);
1365
- return next;
1366
- });
1367
- }
1368
- },
1369
- [handlePluginToggle],
1370
- );
1371
-
1372
- const handleOpenPluginExternalUrl = useCallback(
1373
- async (url: string) => {
1374
- try {
1375
- await openExternalUrl(url);
1376
- } catch (err) {
1377
- setActionNotice(
1378
- err instanceof Error ? err.message : "Failed to open external link.",
1379
- "error",
1380
- 4200,
1381
- );
1382
- }
1383
- },
1384
- [setActionNotice],
1385
- );
1386
-
1387
- // ── Add from directory ──────────────────────────────────────────────
1388
-
1389
- const handleAddFromDirectory = async () => {
1390
- const trimmed = addDirPath.trim();
1391
- if (!trimmed) return;
1392
- setAddDirLoading(true);
1393
- try {
1394
- await client.installRegistryPlugin(trimmed);
1395
- await loadPlugins();
1396
- setAddDirPath("");
1397
- setAddDirOpen(false);
1398
- setActionNotice(`Plugin installed from ${trimmed}`, "success");
1399
- } catch (err) {
1400
- setActionNotice(
1401
- `Failed to add plugin: ${err instanceof Error ? err.message : "unknown error"}`,
1402
- "error",
1403
- 3800,
1404
- );
1405
- }
1406
- setAddDirLoading(false);
1407
- };
1408
-
1409
- // ── Drag-to-reorder handlers ─────────────────────────────────────
1410
-
1411
- const handleDragStart = useCallback(
1412
- (e: React.DragEvent, pluginId: string) => {
1413
- dragRef.current = pluginId;
1414
- setDraggingId(pluginId);
1415
- e.dataTransfer.effectAllowed = "move";
1416
- e.dataTransfer.setData("text/plain", pluginId);
1417
- },
1418
- [],
1419
- );
1420
-
1421
- const handleDragOver = useCallback((e: React.DragEvent, pluginId: string) => {
1422
- e.preventDefault();
1423
- e.dataTransfer.dropEffect = "move";
1424
- if (dragRef.current && dragRef.current !== pluginId) {
1425
- setDragOverId(pluginId);
1426
- }
1427
- }, []);
1428
-
1429
- const handleDrop = useCallback(
1430
- (e: React.DragEvent, targetId: string) => {
1431
- e.preventDefault();
1432
- const srcId = dragRef.current;
1433
- if (!srcId || srcId === targetId) {
1434
- dragRef.current = null;
1435
- setDraggingId(null);
1436
- setDragOverId(null);
1437
- return;
1438
- }
1439
- // Materialize current sorted order, then splice
1440
- if (!allowCustomOrder) return;
1441
- setPluginOrder(() => {
1442
- // Build full order: items in custom order first, then any new ones
1443
- const allIds = nonDbPlugins.map((p: PluginInfo) => p.id);
1444
- let ids: string[];
1445
- if (pluginOrder.length > 0) {
1446
- const known = new Set(pluginOrder);
1447
- ids = [...pluginOrder, ...allIds.filter((id) => !known.has(id))];
1448
- } else {
1449
- ids = sorted.map((p: PluginInfo) => p.id);
1450
- // Pad with any nonDbPlugins not currently in sorted (due to filters)
1451
- const inSorted = new Set(ids);
1452
- for (const id of allIds) {
1453
- if (!inSorted.has(id)) ids.push(id);
1454
- }
1455
- }
1456
- const fromIdx = ids.indexOf(srcId);
1457
- const toIdx = ids.indexOf(targetId);
1458
- if (fromIdx === -1 || toIdx === -1) return ids;
1459
- ids.splice(fromIdx, 1);
1460
- ids.splice(toIdx, 0, srcId);
1461
- return ids;
1462
- });
1463
- dragRef.current = null;
1464
- setDraggingId(null);
1465
- setDragOverId(null);
1466
- },
1467
- [allowCustomOrder, nonDbPlugins, pluginOrder, sorted],
1468
- );
1469
-
1470
- const handleDragEnd = useCallback(() => {
1471
- dragRef.current = null;
1472
- setDraggingId(null);
1473
- setDragOverId(null);
1474
- }, []);
1475
-
1476
- const handleResetOrder = useCallback(() => {
1477
- setPluginOrder([]);
1478
- localStorage.removeItem("pluginOrder");
1479
- }, []);
1480
-
1481
- const renderResolvedIcon = useCallback(
1482
- (
1483
- plugin: PluginInfo,
1484
- options?: {
1485
- className?: string;
1486
- emojiClassName?: string;
1487
- },
1488
- ) => {
1489
- const icon = resolveIcon(plugin);
1490
- if (!icon) {
1491
- return <span className={options?.emojiClassName ?? "text-sm"}>🧩</span>;
1492
- }
1493
- if (typeof icon === "string") {
1494
- const imageSrc = iconImageSource(icon);
1495
- return imageSrc ? (
1496
- <img
1497
- src={imageSrc}
1498
- alt=""
1499
- className={
1500
- options?.className ?? "w-5 h-5 rounded-sm object-contain"
1501
- }
1502
- onError={(e) => {
1503
- (e.currentTarget as HTMLImageElement).style.display = "none";
1504
- }}
1505
- />
1506
- ) : (
1507
- <span className={options?.emojiClassName ?? "text-sm"}>{icon}</span>
1508
- );
1509
- }
1510
- const IconComponent = icon;
1511
- return <IconComponent className={options?.className ?? "w-5 h-5"} />;
1512
- },
1513
- [],
1514
- );
1515
-
1516
- // ── Card renderers ────────────────────────────────────────────────
1517
-
1518
- const renderPluginCard = (p: PluginInfo) => {
1519
- const hasParams = p.parameters && p.parameters.length > 0;
1520
- const isOpen = pluginSettingsOpen.has(p.id);
1521
- const setCount = hasParams
1522
- ? p.parameters.filter((param: PluginParamDef) => param.isSet).length
1523
- : 0;
1524
- const totalCount = hasParams ? p.parameters.length : 0;
1525
- const allParamsSet = !hasParams || setCount === totalCount;
1526
- const isShowcase = p.id === "__ui-showcase__";
1527
- const categoryLabel = isShowcase
1528
- ? "showcase"
1529
- : p.category === "ai-provider"
1530
- ? "ai provider"
1531
- : p.category;
1532
-
1533
- const enabledBorder = isShowcase
1534
- ? "border-l-[3px] border-l-accent"
1535
- : p.enabled
1536
- ? !allParamsSet && hasParams
1537
- ? "border-l-[3px] border-l-warn"
1538
- : "border-l-[3px] border-l-accent"
1539
- : "";
1540
- const isToggleBusy = togglingPlugins.has(p.id);
1541
- const toggleDisabled =
1542
- isToggleBusy || (hasPluginToggleInFlight && !isToggleBusy);
1543
-
1544
- const isDragging = draggingId === p.id;
1545
- const isDragOver = dragOverId === p.id && draggingId !== p.id;
1546
- const pluginLinks = getPluginResourceLinks(p);
1547
-
1548
- return (
1549
- <li
1550
- key={p.id}
1551
- draggable={allowCustomOrder}
1552
- onDragStart={
1553
- allowCustomOrder ? (e) => handleDragStart(e, p.id) : undefined
1554
- }
1555
- onDragOver={
1556
- allowCustomOrder ? (e) => handleDragOver(e, p.id) : undefined
1557
- }
1558
- onDrop={allowCustomOrder ? (e) => handleDrop(e, p.id) : undefined}
1559
- onDragEnd={allowCustomOrder ? handleDragEnd : undefined}
1560
- className={`border border-border bg-card transition-colors duration-150 flex flex-col ${enabledBorder} ${isOpen ? "ring-1 ring-accent" : "hover:border-accent/40"
1561
- } ${isDragging ? "opacity-30" : ""} ${isDragOver ? "ring-2 ring-accent/60" : ""}`}
1562
- data-plugin-id={p.id}
1563
- >
1564
- {/* Top: drag handle + icon + name + toggle */}
1565
- <div className="flex items-center gap-2 px-3 pt-3 pb-1">
1566
- {allowCustomOrder && (
1567
- <span
1568
- className="text-[10px] text-muted opacity-30 hover:opacity-70 cursor-grab active:cursor-grabbing shrink-0 select-none leading-none"
1569
- title={t("pluginsview.DragToReorder")}
1570
- >
1571
- {t("pluginsview.X2807")}
1572
- </span>
1573
- )}
1574
- <span className="font-bold text-sm flex items-center gap-1.5 min-w-0 truncate flex-1">
1575
- {(() => {
1576
- const icon = resolveIcon(p);
1577
- if (!icon) return null;
1578
- if (typeof icon === "string") {
1579
- const imageSrc = iconImageSource(icon);
1580
- return imageSrc ? (
1581
- <img
1582
- src={imageSrc}
1583
- alt=""
1584
- className="w-5 h-5 rounded-sm object-contain"
1585
- onError={(e) => {
1586
- (e.currentTarget as HTMLImageElement).style.display =
1587
- "none";
1588
- }}
1589
- />
1590
- ) : (
1591
- <span className="text-sm">{icon}</span>
1592
- );
1593
- }
1594
- const IconComponent = icon;
1595
- return <IconComponent className="w-5 h-5" />;
1596
- })()}
1597
- {p.name}
1598
- </span>
1599
- {isShowcase ? (
1600
- <span className="text-[10px] font-bold tracking-wider px-2.5 py-[2px] border border-accent text-txt bg-accent-subtle shrink-0">
1601
- {t("pluginsview.DEMO")}
1602
- </span>
1603
- ) : (
1604
- <button
1605
- type="button"
1606
- data-plugin-toggle={p.id}
1607
- className={`text-[10px] font-bold tracking-wider px-2.5 py-[2px] border transition-colors duration-150 shrink-0 ${p.enabled
1608
- ? "bg-accent text-accent-fg border-accent"
1609
- : "bg-transparent text-muted border-border hover:text-txt"
1610
- } ${toggleDisabled
1611
- ? "opacity-60 cursor-not-allowed"
1612
- : "cursor-pointer"
1613
- }`}
1614
- onClick={(e) => {
1615
- e.stopPropagation();
1616
- void handleTogglePlugin(p.id, !p.enabled);
1617
- }}
1618
- disabled={toggleDisabled}
1619
- >
1620
- {isToggleBusy ? "APPLYING" : p.enabled ? "ON" : "OFF"}
1621
- </button>
1622
- )}
1623
- </div>
1624
-
1625
- {/* Badges: category + version + loaded status */}
1626
- <div className="flex items-center gap-1.5 px-3 pb-1.5">
1627
- <span className="text-[10px] px-1.5 py-px border border-border bg-surface text-muted lowercase tracking-wide whitespace-nowrap">
1628
- {categoryLabel}
1629
- </span>
1630
- {p.version && (
1631
- <span className="text-[10px] font-mono text-muted opacity-70">
1632
- v{p.version}
1633
- </span>
1634
- )}
1635
- {p.enabled && !p.isActive && !isShowcase && (
1636
- <span
1637
- className={`text-[10px] px-1.5 py-px border lowercase tracking-wide whitespace-nowrap ${p.loadError
1638
- ? "border-destructive bg-[rgba(153,27,27,0.04)] text-destructive"
1639
- : "border-warn bg-[rgba(234,179,8,0.06)] text-warn"
1640
- }`}
1641
- title={
1642
- p.loadError || "Plugin is enabled but not loaded in the runtime"
1643
- }
1644
- >
1645
- {p.loadError ? "load failed" : "not installed"}
1646
- </span>
1647
- )}
1648
- {isToggleBusy && (
1649
- <span className="text-[10px] px-1.5 py-px border border-accent bg-accent-subtle text-txt lowercase tracking-wide whitespace-nowrap">
1650
- {t("pluginsview.restarting")}
1651
- </span>
1652
- )}
1653
- </div>
1654
-
1655
- {/* Description — clamped to 3 lines */}
1656
- <p
1657
- className="text-xs text-muted px-3 pb-2 flex-1"
1658
- style={{
1659
- display: "-webkit-box",
1660
- WebkitLineClamp: 3,
1661
- WebkitBoxOrient: "vertical",
1662
- overflow: "hidden",
1663
- }}
1664
- >
1665
- {p.description || "No description available"}
1666
- </p>
1667
-
1668
- {(p.tags?.length ?? 0) > 0 && (
1669
- <div className="flex flex-wrap gap-1.5 px-3 pb-2">
1670
- {p.tags?.slice(0, 4).map((tag) => (
1671
- <span
1672
- key={`${p.id}:${tag}`}
1673
- className="text-[10px] px-1.5 py-px border border-border/50 bg-black/10 text-muted lowercase tracking-wide whitespace-nowrap"
1674
- >
1675
- {tag}
1676
- </span>
1677
- ))}
1678
- </div>
1679
- )}
1680
-
1681
- {pluginLinks.length > 0 && (
1682
- <div className="flex flex-wrap gap-2 px-3 pb-2">
1683
- {pluginLinks.map((link) => (
1684
- <Button
1685
- key={`${p.id}:${link.key}`}
1686
- variant="outline"
1687
- size="sm"
1688
- className="h-6 px-2 text-[10px] font-bold border-border/40 text-muted hover:text-txt hover:border-accent hover:bg-accent/5 backdrop-blur-sm transition-all"
1689
- onClick={(e) => {
1690
- e.stopPropagation();
1691
- void handleOpenPluginExternalUrl(link.url);
1692
- }}
1693
- title={`${link.label}: ${link.url}`}
1694
- >
1695
- {link.label}
1696
- </Button>
1697
- ))}
1698
- </div>
1699
- )}
1700
-
1701
- {/* Bottom bar: config status + settings button */}
1702
- <div className="flex items-center gap-3 px-4 py-3 border-t border-border/40 mt-auto bg-black/5">
1703
- {hasParams && !isShowcase ? (
1704
- <>
1705
- <span
1706
- className={`inline-block w-2 h-2 rounded-full shadow-[0_0_10px_currentColor] shrink-0 ${allParamsSet
1707
- ? "bg-ok text-ok"
1708
- : "bg-destructive text-destructive"
1709
- }`}
1710
- />
1711
- <span className="text-[11px] font-bold tracking-wide text-muted">
1712
- {setCount}/{totalCount} {t("pluginsview.configured")}
1713
- </span>
1714
- </>
1715
- ) : !hasParams && !isShowcase ? (
1716
- <span className="text-[11px] font-bold tracking-wide text-muted/60">
1717
- {t("pluginsview.NoConfigNeeded")}
1718
- </span>
1719
- ) : (
1720
- <span className="text-[11px] font-bold tracking-wide text-muted/60">
1721
- {t("pluginsview.23FieldDemos")}
1722
- </span>
1723
- )}
1724
- <div className="flex-1" />
1725
- {p.enabled &&
1726
- !p.isActive &&
1727
- p.npmName &&
1728
- !isShowcase &&
1729
- !p.loadError && (
1730
- <Button
1731
- variant="default"
1732
- size="sm"
1733
- className="h-7 px-3 text-[10px] font-bold tracking-wide shadow-sm max-w-[140px] truncate"
1734
- disabled={installingPlugins.has(p.id)}
1735
- onClick={(e) => {
1736
- e.stopPropagation();
1737
- handleInstallPlugin(p.id, p.npmName ?? "");
1738
- }}
1739
- >
1740
- {installingPlugins.has(p.id)
1741
- ? installProgress.get(p.npmName ?? "")?.message ||
1742
- "Installing..."
1743
- : "Install"}
1744
- </Button>
1745
- )}
1746
- {hasParams && (
1747
- <Button
1748
- variant="ghost"
1749
- size="sm"
1750
- className={`h-7 px-2.5 text-[11px] font-bold transition-all flex items-center gap-1.5 ${isOpen
1751
- ? "text-txt bg-accent/10 hover:bg-accent/20"
1752
- : "text-muted hover:text-txt hover:bg-white/5"
1753
- }`}
1754
- onClick={(e) => {
1755
- e.stopPropagation();
1756
- toggleSettings(p.id);
1757
- }}
1758
- title={t("pluginsview.Settings")}
1759
- >
1760
- <span className="text-[14px] leading-none">&#9881;</span>
1761
- <span
1762
- className={`inline-block text-[10px] transition-transform duration-200 ${isOpen ? "rotate-90" : ""}`}
1763
- >
1764
- &#9654;
1765
- </span>
1766
- </Button>
1767
- )}
1768
- </div>
1769
-
1770
- {/* Validation errors */}
1771
- {p.enabled && p.validationErrors && p.validationErrors.length > 0 && (
1772
- <div className="px-3 py-1.5 border-t border-destructive bg-[rgba(153,27,27,0.04)] text-xs">
1773
- {p.validationErrors.map(
1774
- (err: { field: string; message: string }) => (
1775
- <div
1776
- key={`${err.field}:${err.message}`}
1777
- className="text-destructive mb-0.5 text-[10px]"
1778
- >
1779
- {err.field}: {err.message}
1780
- </div>
1781
- ),
1782
- )}
1783
- </div>
1784
- )}
1785
-
1786
- {/* Validation warnings */}
1787
- {p.enabled &&
1788
- p.validationWarnings &&
1789
- p.validationWarnings.length > 0 && (
1790
- <div className="px-3 py-1">
1791
- {p.validationWarnings.map(
1792
- (w: { field: string; message: string }) => (
1793
- <div
1794
- key={`${w.field}:${w.message}`}
1795
- className="text-warn text-[10px]"
1796
- >
1797
- {w.message}
1798
- </div>
1799
- ),
1800
- )}
1801
- </div>
1802
- )}
1803
- </li>
1804
- );
1805
- };
1806
-
1807
- /** Render a grid of plugin cards. */
1808
- const renderPluginGrid = (plugins: PluginInfo[]) => (
1809
- <ul className="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-3 m-0 p-0 list-none">
1810
- {plugins.map((p: PluginInfo) => renderPluginCard(p))}
1811
- </ul>
1812
- );
1813
-
1814
- // Resolve the plugin whose settings dialog is currently open.
1815
- // Exclude ai-provider plugins — those are configured in Settings.
1816
- const settingsDialogPlugin =
1817
- Array.from(pluginSettingsOpen)
1818
- .map((id) => nonDbPlugins.find((plugin) => plugin.id === id) ?? null)
1819
- .find((plugin) => (plugin?.parameters?.length ?? 0) > 0) ?? null;
1820
-
1821
- // ── Game-modal state ──────────────────────────────────────────────
1822
- const [gameSelectedId, setGameSelectedId] = useState<string | null>(null);
1823
- const [gameMobileDetail, setGameMobileDetail] = useState(false);
1824
- const gameNarrow =
1825
- typeof window !== "undefined" && typeof window.matchMedia === "function"
1826
- ? window.matchMedia("(max-width: 600px)").matches
1827
- : false;
1828
- const [connectorExpandedIds, setConnectorExpandedIds] = useState<Set<string>>(
1829
- () => new Set(),
1830
- );
1831
- const [connectorSelectedId, setConnectorSelectedId] = useState<string | null>(
1832
- null,
1833
- );
1834
- const [desktopConnectorLayout, setDesktopConnectorLayout] = useState(() =>
1835
- typeof window !== "undefined" && typeof window.matchMedia === "function"
1836
- ? window.matchMedia("(min-width: 1024px)").matches
1837
- : false,
1838
- );
1839
- const connectorSectionRefs = useRef<Record<string, HTMLElement | null>>({});
1840
-
1841
- // Auto-select first visible plugin in game modal
1842
- const gameVisiblePlugins = visiblePlugins.filter(
1843
- (p: PluginInfo) => p.id !== "__ui-showcase__",
1844
- );
1845
- const effectiveGameSelected = gameVisiblePlugins.find(
1846
- (p: PluginInfo) => p.id === gameSelectedId,
1847
- )
1848
- ? gameSelectedId
1849
- : (gameVisiblePlugins[0]?.id ?? null);
1850
- const selectedPlugin =
1851
- gameVisiblePlugins.find(
1852
- (p: PluginInfo) => p.id === effectiveGameSelected,
1853
- ) ?? null;
1854
- const selectedPluginLinks = selectedPlugin
1855
- ? getPluginResourceLinks(selectedPlugin)
1856
- : [];
1857
-
1858
- useEffect(() => {
1859
- if (!isSocialMode || !inModal) return;
1860
- if (pluginStatusFilter !== "disabled") return;
1861
- setState("pluginStatusFilter", "all");
1862
- }, [inModal, isSocialMode, pluginStatusFilter, setState]);
1863
-
1864
- useEffect(() => {
1865
- if (!isSocialMode || !inModal) return;
1866
- if (
1867
- typeof window === "undefined" ||
1868
- typeof window.matchMedia !== "function"
1869
- )
1870
- return;
1871
-
1872
- const media = window.matchMedia("(min-width: 1024px)");
1873
- const syncLayout = () => {
1874
- setDesktopConnectorLayout(media.matches);
1875
- };
1876
-
1877
- syncLayout();
1878
- if (typeof media.addEventListener === "function") {
1879
- media.addEventListener("change", syncLayout);
1880
- return () => media.removeEventListener("change", syncLayout);
1881
- }
1882
-
1883
- media.addListener(syncLayout);
1884
- return () => media.removeListener(syncLayout);
1885
- }, [inModal, isSocialMode]);
1886
-
1887
- useEffect(() => {
1888
- if (!isSocialMode || !inModal) return;
1889
- if (visiblePlugins.length === 0) {
1890
- setConnectorSelectedId(null);
1891
- setConnectorExpandedIds(new Set());
1892
- return;
1893
- }
1894
-
1895
- setConnectorSelectedId((prev) => {
1896
- if (visiblePlugins.some((plugin) => plugin.id === prev)) {
1897
- return prev;
1898
- }
1899
- return desktopConnectorLayout ? (visiblePlugins[0]?.id ?? null) : null;
1900
- });
1901
- }, [desktopConnectorLayout, inModal, isSocialMode, visiblePlugins]);
1902
-
1903
- useEffect(() => {
1904
- if (!isSocialMode || !inModal || !desktopConnectorLayout) return;
1905
- if (!connectorSelectedId) return;
1906
- setConnectorExpandedIds(new Set([connectorSelectedId]));
1907
- }, [connectorSelectedId, desktopConnectorLayout, inModal, isSocialMode]);
1908
-
1909
- useEffect(() => {
1910
- if (!isSocialMode || !inModal || desktopConnectorLayout) return;
1911
- setConnectorExpandedIds(new Set());
1912
- }, [desktopConnectorLayout, inModal, isSocialMode]);
1913
-
1914
- const scrollConnectorIntoView = useCallback((pluginId: string) => {
1915
- const element = connectorSectionRefs.current[pluginId];
1916
- if (element && typeof element.scrollIntoView === "function") {
1917
- element.scrollIntoView({ behavior: "smooth", block: "start" });
1918
- }
1919
- }, []);
1920
-
1921
- const handleConnectorSelect = useCallback(
1922
- (pluginId: string) => {
1923
- setConnectorSelectedId(pluginId);
1924
- setConnectorExpandedIds((prev) => {
1925
- if (desktopConnectorLayout) {
1926
- return new Set([pluginId]);
1927
- }
1928
- const next = new Set(prev);
1929
- next.add(pluginId);
1930
- return next;
1931
- });
1932
- scrollConnectorIntoView(pluginId);
1933
- },
1934
- [desktopConnectorLayout, scrollConnectorIntoView],
1935
- );
1936
-
1937
- const handleConnectorSectionToggle = useCallback(
1938
- (pluginId: string) => {
1939
- setConnectorSelectedId(pluginId);
1940
- let shouldScroll = false;
1941
- setConnectorExpandedIds((prev) => {
1942
- if (desktopConnectorLayout) {
1943
- // Accordion: toggle off if already open, otherwise open this one only
1944
- if (prev.has(pluginId)) return new Set();
1945
- shouldScroll = true;
1946
- return new Set([pluginId]);
1947
- }
1948
- const next = new Set(prev);
1949
- if (next.has(pluginId)) next.delete(pluginId);
1950
- else next.add(pluginId);
1951
- return next;
1952
- });
1953
- if (desktopConnectorLayout && shouldScroll) {
1954
- scrollConnectorIntoView(pluginId);
1955
- }
1956
- },
1957
- [desktopConnectorLayout, scrollConnectorIntoView],
1958
- );
1959
-
1960
- // ── Game-modal render ─────────────────────────────────────────────
1961
- if (inModal && isSocialMode) {
1962
- return (
1963
- <div
1964
- data-testid="plugins-view-social"
1965
- className={`flex min-h-full min-w-0 w-full flex-col bg-bg ${desktopConnectorLayout ? "md:flex-row" : ""
1966
- }`}
1967
- >
1968
- {desktopConnectorLayout && (
1969
- <aside
1970
- data-testid="connectors-settings-sidebar"
1971
- className="flex w-[22rem] shrink-0 border-r border-border/50 bg-bg/35 backdrop-blur-xl"
1972
- >
1973
- <div className="flex min-h-full flex-1 flex-col sticky top-0 max-h-screen">
1974
- <div className="border-b border-border/40 px-5 py-5 text-center">
1975
- <div className="text-[11px] font-semibold uppercase tracking-[0.18em] text-muted/80">
1976
- Connectors
1977
- </div>
1978
- <div className="mt-2 text-sm text-muted">
1979
- {enabledCount} enabled of {categoryPlugins.length}
1980
- </div>
1981
- </div>
1982
- <nav className="flex-1 space-y-2 overflow-y-auto px-4 py-4">
1983
- {(desktopConnectorLayout
1984
- ? visiblePlugins.filter((plugin) => {
1985
- return plugin.id === connectorSelectedId;
1986
- })
1987
- : visiblePlugins
1988
- ).map((plugin) => {
1989
- const isSelected = connectorSelectedId === plugin.id;
1990
- const isExpanded = connectorExpandedIds.has(plugin.id);
1991
- const isToggleBusy = togglingPlugins.has(plugin.id);
1992
- const toggleDisabled =
1993
- isToggleBusy || (hasPluginToggleInFlight && !isToggleBusy);
1994
-
1995
- return (
1996
- <div
1997
- key={plugin.id}
1998
- className={`flex items-center gap-2 rounded-2xl border px-3 py-2 transition-all ${isSelected
1999
- ? "border-accent/40 bg-accent/10 text-txt shadow-[0_10px_30px_rgba(var(--accent),0.08)]"
2000
- : "border-transparent bg-transparent text-muted hover:border-border/60 hover:bg-card/55 hover:text-txt"
2001
- }`}
2002
- >
2003
- <button
2004
- type="button"
2005
- className="flex min-w-0 flex-1 items-center gap-3 text-left"
2006
- onClick={() => handleConnectorSelect(plugin.id)}
2007
- aria-current={isSelected ? "page" : undefined}
2008
- >
2009
- <span
2010
- className={`flex h-8 w-8 shrink-0 items-center justify-center rounded-xl border p-1.5 ${isSelected
2011
- ? "border-accent/30 bg-accent/18 text-txt-strong"
2012
- : "border-border/50 bg-bg-accent/80 text-muted"
2013
- }`}
2014
- >
2015
- {renderResolvedIcon(plugin, {
2016
- className:
2017
- "h-4 w-4 shrink-0 rounded-sm object-contain",
2018
- emojiClassName: "text-sm",
2019
- })}
2020
- </span>
2021
- <span className="min-w-0 flex-1 truncate text-sm font-semibold leading-none">
2022
- {plugin.name}
2023
- </span>
2024
- </button>
2025
- <button
2026
- type="button"
2027
- className={`shrink-0 rounded-full border px-2.5 py-1 text-[10px] font-bold tracking-[0.16em] transition-colors ${plugin.enabled
2028
- ? "border-accent bg-accent text-accent-fg"
2029
- : "border-border bg-transparent text-muted hover:border-accent/40 hover:text-txt"
2030
- } ${toggleDisabled
2031
- ? "cursor-not-allowed opacity-60"
2032
- : "cursor-pointer"
2033
- }`}
2034
- onClick={() =>
2035
- void handleTogglePlugin(plugin.id, !plugin.enabled)
2036
- }
2037
- disabled={toggleDisabled}
2038
- >
2039
- {isToggleBusy ? "..." : plugin.enabled ? "ON" : "OFF"}
2040
- </button>
2041
- <span
2042
- className={`shrink-0 text-muted transition-transform ${isExpanded ? "rotate-90" : ""
2043
- }`}
2044
- >
2045
- <ChevronRight className="h-4 w-4" />
2046
- </span>
2047
- </div>
2048
- );
2049
- })}
2050
- </nav>
2051
- </div>
2052
- </aside>
2053
- )}
2054
-
2055
- <div className="min-w-0 flex-1">
2056
- <div className="sticky top-0 z-20 border-b border-border/50 bg-bg/85 px-4 py-4 shadow-[0_12px_30px_rgba(0,0,0,0.14)] backdrop-blur-xl sm:px-6 lg:px-8">
2057
- <div className="mx-auto max-w-5xl">
2058
- <div className="flex flex-col gap-3 sm:flex-row sm:items-center">
2059
- <Input
2060
- type="text"
2061
- className="h-11 w-full rounded-xl border-border/60 bg-card/70 text-sm shadow-sm"
2062
- placeholder="Search connectors..."
2063
- value={pluginSearch}
2064
- onChange={(e) => setState("pluginSearch", e.target.value)}
2065
- />
2066
- <div className="flex shrink-0 gap-1.5 rounded-xl border border-white/5 bg-black/10 p-1">
2067
- {(["all", "enabled"] as const).map((status) => (
2068
- <Button
2069
- key={status}
2070
- variant={
2071
- effectiveStatusFilter === status ? "default" : "ghost"
2072
- }
2073
- size="sm"
2074
- className={`h-8 px-3 text-[11px] font-bold tracking-wide transition-all ${effectiveStatusFilter === status
2075
- ? "shadow-sm"
2076
- : "text-muted hover:bg-white/5 hover:text-txt"
2077
- }`}
2078
- onClick={() =>
2079
- setState("pluginStatusFilter", status as StatusFilter)
2080
- }
2081
- >
2082
- {status === "all"
2083
- ? `All (${categoryPlugins.length})`
2084
- : `Enabled (${enabledCount})`}
2085
- </Button>
2086
- ))}
2087
- </div>
2088
- </div>
2089
- </div>
2090
- </div>
2091
-
2092
- <div className="mx-auto max-w-5xl px-4 py-4 sm:px-6 sm:py-5 lg:px-8 lg:py-6">
2093
- {hasPluginToggleInFlight && (
2094
- <div className="mb-4 rounded-2xl border border-accent bg-accent-subtle px-4 py-3 text-[11px] text-txt">
2095
- {t("pluginsview.ApplyingPluginChan")}
2096
- </div>
2097
- )}
2098
-
2099
- {visiblePlugins.length === 0 ? (
2100
- <div className="rounded-2xl border border-dashed border-border px-5 py-10 text-center text-muted">
2101
- {effectiveSearch
2102
- ? "No connectors match your search."
2103
- : "No connectors match your filters."}
2104
- </div>
2105
- ) : (
2106
- <div
2107
- data-testid="connectors-settings-content"
2108
- className="space-y-4"
2109
- >
2110
- {(desktopConnectorLayout
2111
- ? visiblePlugins.filter((p) => p.id === connectorSelectedId)
2112
- : visiblePlugins
2113
- ).map((plugin) => {
2114
- const hasParams =
2115
- (plugin.parameters?.length ?? 0) > 0 &&
2116
- plugin.id !== "__ui-showcase__";
2117
- const isExpanded = connectorExpandedIds.has(plugin.id);
2118
- const isSelected = connectorSelectedId === plugin.id;
2119
- const setCount = hasParams
2120
- ? plugin.parameters.filter((param) => param.isSet).length
2121
- : 0;
2122
- const totalCount = hasParams ? plugin.parameters.length : 0;
2123
- const allParamsSet = !hasParams || setCount === totalCount;
2124
- const isToggleBusy = togglingPlugins.has(plugin.id);
2125
- const toggleDisabled =
2126
- isToggleBusy || (hasPluginToggleInFlight && !isToggleBusy);
2127
- const isSaving = pluginSaving.has(plugin.id);
2128
- const saveSuccess = pluginSaveSuccess.has(plugin.id);
2129
- const testResult = testResults.get(plugin.id);
2130
- const pluginLinks = getPluginResourceLinks(plugin);
2131
-
2132
- return (
2133
- <section
2134
- key={plugin.id}
2135
- ref={(element) => {
2136
- connectorSectionRefs.current[plugin.id] = element;
2137
- }}
2138
- data-testid={`connector-section-${plugin.id}`}
2139
- className={`overflow-hidden rounded-[1.4rem] border bg-card/90 shadow-sm transition-all ${isSelected
2140
- ? "border-accent/35 shadow-[0_18px_40px_rgba(var(--accent),0.08)]"
2141
- : "border-border/50"
2142
- }`}
2143
- >
2144
- <div className="flex items-start gap-3 px-4 py-4 sm:px-5">
2145
- <button
2146
- type="button"
2147
- data-testid={`connector-header-${plugin.id}`}
2148
- className="flex min-w-0 flex-1 items-start gap-3 text-left"
2149
- onClick={() =>
2150
- handleConnectorSectionToggle(plugin.id)
2151
- }
2152
- >
2153
- <span
2154
- className={`mt-0.5 flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl border p-2.5 ${isSelected
2155
- ? "border-accent/30 bg-accent/18 text-txt-strong"
2156
- : "border-border/50 bg-bg-accent/80 text-muted"
2157
- }`}
2158
- >
2159
- {renderResolvedIcon(plugin, {
2160
- className:
2161
- "h-4 w-4 shrink-0 rounded-sm object-contain",
2162
- emojiClassName: "text-base",
2163
- })}
2164
- </span>
2165
- <span className="min-w-0 flex-1">
2166
- <span className="flex min-w-0 flex-wrap items-center gap-2">
2167
- <span className="truncate text-sm font-semibold text-txt">
2168
- {plugin.name}
2169
- </span>
2170
- <span
2171
- className={`rounded-full border px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.14em] ${allParamsSet
2172
- ? "border-ok/30 bg-ok/10 text-ok"
2173
- : "border-warn/30 bg-warn/10 text-warn"
2174
- }`}
2175
- >
2176
- {allParamsSet ? "Ready" : "Needs setup"}
2177
- </span>
2178
- {plugin.version && (
2179
- <span className="text-[11px] font-mono text-muted/80">
2180
- v{plugin.version}
2181
- </span>
2182
- )}
2183
- </span>
2184
- <span className="mt-1 block text-sm text-muted">
2185
- {plugin.description || "No description available"}
2186
- </span>
2187
- <span className="mt-2 flex flex-wrap items-center gap-2 text-[11px] text-muted">
2188
- <span>
2189
- {hasParams
2190
- ? `${setCount}/${totalCount} configured`
2191
- : "No configuration needed"}
2192
- </span>
2193
- {plugin.enabled && !plugin.isActive && (
2194
- <span
2195
- className={`rounded-full border px-2 py-0.5 ${plugin.loadError
2196
- ? "border-danger/30 bg-danger/10 text-danger"
2197
- : "border-warn/30 bg-warn/10 text-warn"
2198
- }`}
2199
- >
2200
- {plugin.loadError
2201
- ? "Load failed"
2202
- : "Not installed"}
2203
- </span>
2204
- )}
2205
- </span>
2206
- </span>
2207
- </button>
2208
-
2209
- <div className="flex shrink-0 items-center gap-2">
2210
- <button
2211
- type="button"
2212
- className={`rounded-full border px-3 py-1.5 text-[10px] font-bold tracking-[0.16em] transition-colors ${plugin.enabled
2213
- ? "border-accent bg-accent text-accent-fg"
2214
- : "border-border bg-transparent text-muted hover:border-accent/40 hover:text-txt"
2215
- } ${toggleDisabled
2216
- ? "cursor-not-allowed opacity-60"
2217
- : "cursor-pointer"
2218
- }`}
2219
- onClick={() =>
2220
- void handleTogglePlugin(
2221
- plugin.id,
2222
- !plugin.enabled,
2223
- )
2224
- }
2225
- disabled={toggleDisabled}
2226
- >
2227
- {isToggleBusy
2228
- ? "..."
2229
- : plugin.enabled
2230
- ? "ON"
2231
- : "OFF"}
2232
- </button>
2233
- <button
2234
- type="button"
2235
- className={`flex items-center gap-1 rounded-full border px-3 py-1.5 text-[11px] font-semibold transition-colors ${isExpanded
2236
- ? "border-accent/40 bg-accent/10 text-txt"
2237
- : "border-border/50 text-muted hover:border-accent/40 hover:text-txt"
2238
- }`}
2239
- onClick={() =>
2240
- handleConnectorSectionToggle(plugin.id)
2241
- }
2242
- aria-expanded={isExpanded}
2243
- aria-label={`${isExpanded ? "Collapse" : "Expand"} ${plugin.name}`}
2244
- >
2245
- <span>{isExpanded ? "Collapse" : "Expand"}</span>
2246
- <ChevronRight
2247
- className={`h-4 w-4 transition-transform ${isExpanded ? "rotate-90" : ""
2248
- }`}
2249
- />
2250
- </button>
2251
- </div>
2252
- </div>
2253
-
2254
- {isExpanded && (
2255
- <div className="border-t border-border/40 bg-black/5 px-4 py-4 sm:px-5">
2256
- {plugin.validationErrors &&
2257
- plugin.validationErrors.length > 0 && (
2258
- <div className="mb-4 rounded-2xl border border-danger/30 bg-danger/10 px-4 py-3 text-sm text-danger">
2259
- {plugin.validationErrors.map((error) => (
2260
- <div
2261
- key={`${plugin.id}:${error.field}:${error.message}`}
2262
- >
2263
- {error.field}: {error.message}
2264
- </div>
2265
- ))}
2266
- </div>
2267
- )}
2268
-
2269
- {plugin.validationWarnings &&
2270
- plugin.validationWarnings.length > 0 && (
2271
- <div className="mb-4 rounded-2xl border border-warn/30 bg-warn/10 px-4 py-3 text-sm text-warn">
2272
- {plugin.validationWarnings.map((warning) => (
2273
- <div
2274
- key={`${plugin.id}:${warning.field}:${warning.message}`}
2275
- >
2276
- {warning.message}
2277
- </div>
2278
- ))}
2279
- </div>
2280
- )}
2281
-
2282
- {pluginLinks.length > 0 && (
2283
- <div className="mb-4 flex flex-wrap gap-2">
2284
- {pluginLinks.map((link) => (
2285
- <Button
2286
- key={`${plugin.id}:${link.key}`}
2287
- variant="outline"
2288
- size="sm"
2289
- className="h-8 rounded-xl border-border/40 bg-card/40 px-3 text-[11px] font-semibold text-muted transition-all hover:border-accent hover:bg-accent/5 hover:text-txt"
2290
- onClick={() => {
2291
- void handleOpenPluginExternalUrl(link.url);
2292
- }}
2293
- title={`${link.label}: ${link.url}`}
2294
- >
2295
- {link.label}
2296
- </Button>
2297
- ))}
2298
- </div>
2299
- )}
2300
-
2301
- {plugin.enabled &&
2302
- !plugin.isActive &&
2303
- plugin.npmName &&
2304
- !plugin.loadError && (
2305
- <div className="mb-4 rounded-2xl border border-warn/30 bg-warn/10 px-4 py-3 text-sm text-txt">
2306
- <div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
2307
- <div>
2308
- Install this connector to activate it in the
2309
- runtime.
2310
- </div>
2311
- <Button
2312
- variant="default"
2313
- size="sm"
2314
- className="h-8 rounded-xl px-4 text-[11px] font-bold"
2315
- disabled={installingPlugins.has(plugin.id)}
2316
- onClick={() =>
2317
- handleInstallPlugin(
2318
- plugin.id,
2319
- plugin.npmName ?? "",
2320
- )
2321
- }
2322
- >
2323
- {installingPlugins.has(plugin.id)
2324
- ? installProgress.get(
2325
- plugin.npmName ?? "",
2326
- )?.message || "Installing..."
2327
- : "Install Plugin"}
2328
- </Button>
2329
- </div>
2330
- </div>
2331
- )}
2332
-
2333
- {hasParams ? (
2334
- <div className="space-y-4">
2335
- <PluginConfigForm
2336
- plugin={plugin}
2337
- pluginConfigs={pluginConfigs}
2338
- onParamChange={handleParamChange}
2339
- />
2340
- {plugin.id === "whatsapp" && (
2341
- <WhatsAppQrOverlay accountId="default" />
2342
- )}
2343
- </div>
2344
- ) : (
2345
- <div className="rounded-2xl border border-border/40 bg-card/40 px-4 py-3 text-sm text-muted">
2346
- No configuration needed.
2347
- </div>
2348
- )}
2349
-
2350
- <div className="mt-4 flex flex-wrap items-center gap-2">
2351
- {plugin.isActive && (
2352
- <Button
2353
- variant={
2354
- testResult?.success
2355
- ? "default"
2356
- : testResult?.error
2357
- ? "destructive"
2358
- : "outline"
2359
- }
2360
- size="sm"
2361
- className={`h-8 rounded-xl px-4 text-[11px] font-bold transition-all ${testResult?.loading
2362
- ? "cursor-wait opacity-70"
2363
- : testResult?.success
2364
- ? "border-ok bg-ok text-ok-fg hover:bg-ok/90"
2365
- : testResult?.error
2366
- ? "border-danger bg-danger text-danger-fg hover:bg-danger/90"
2367
- : "border-border/40 bg-card/40 hover:border-accent/40"
2368
- }`}
2369
- disabled={testResult?.loading}
2370
- onClick={() =>
2371
- void handleTestConnection(plugin.id)
2372
- }
2373
- >
2374
- {testResult?.loading
2375
- ? "Testing..."
2376
- : testResult?.success
2377
- ? `OK (${testResult.durationMs}ms)`
2378
- : testResult?.error
2379
- ? `Failed: ${testResult.error}`
2380
- : "Test Connection"}
2381
- </Button>
2382
- )}
2383
- {hasParams && (
2384
- <>
2385
- <Button
2386
- variant="ghost"
2387
- size="sm"
2388
- className="h-8 rounded-xl px-4 text-[11px] font-semibold text-muted hover:text-txt"
2389
- onClick={() => handleConfigReset(plugin.id)}
2390
- >
2391
- Reset
2392
- </Button>
2393
- <Button
2394
- variant={
2395
- saveSuccess ? "default" : "secondary"
2396
- }
2397
- size="sm"
2398
- className={`h-8 rounded-xl px-4 text-[11px] font-bold transition-all ${saveSuccess
2399
- ? "bg-ok text-ok-fg hover:bg-ok/90"
2400
- : "bg-accent text-accent-fg hover:bg-accent/90"
2401
- }`}
2402
- onClick={() =>
2403
- void handleConfigSave(plugin.id)
2404
- }
2405
- disabled={isSaving}
2406
- >
2407
- {isSaving
2408
- ? "Saving..."
2409
- : saveSuccess
2410
- ? "Saved"
2411
- : "Save Settings"}
2412
- </Button>
2413
- </>
2414
- )}
2415
- </div>
2416
- </div>
2417
- )}
2418
- </section>
2419
- );
2420
- })}
2421
- </div>
2422
- )}
2423
- </div>
2424
- </div>
2425
- </div>
2426
- );
2427
- }
2428
-
2429
- if (inModal) {
2430
- const sectionTitle =
2431
- mode === "social"
2432
- ? "Connectors"
2433
- : mode === "connectors"
2434
- ? "Connectors"
2435
- : label;
2436
- return (
2437
- <div className="plugins-game-modal plugins-game-modal--inline">
2438
- <div
2439
- className={`plugins-game-list-panel${gameNarrow && gameMobileDetail ? " is-hidden" : ""
2440
- }`}
2441
- >
2442
- <div className="plugins-game-list-head">
2443
- <div className="plugins-game-section-title">{sectionTitle}</div>
2444
- </div>
2445
- <div className="plugins-game-list-scroll">
2446
- {gameVisiblePlugins.length === 0 ? (
2447
- <div className="plugins-game-list-empty">
2448
- No {resultLabel} {t("pluginsview.found")}
2449
- </div>
2450
- ) : (
2451
- gameVisiblePlugins.map((p: PluginInfo) => (
2452
- <button
2453
- key={p.id}
2454
- type="button"
2455
- className={`plugins-game-card${effectiveGameSelected === p.id ? " is-selected" : ""
2456
- }${!p.enabled ? " is-disabled" : ""}`}
2457
- onClick={() => {
2458
- setGameSelectedId(p.id);
2459
- if (gameNarrow) setGameMobileDetail(true);
2460
- }}
2461
- >
2462
- <div className="plugins-game-card-icon-shell">
2463
- <span className="plugins-game-card-icon">
2464
- {(() => {
2465
- const icon = resolveIcon(p);
2466
- if (!icon) return "🧩";
2467
- if (typeof icon === "string") {
2468
- const imageSrc = iconImageSource(icon);
2469
- return imageSrc ? (
2470
- <img
2471
- src={imageSrc}
2472
- alt=""
2473
- className="plugins-game-card-icon"
2474
- style={{ objectFit: "contain" }}
2475
- />
2476
- ) : (
2477
- icon
2478
- );
2479
- }
2480
- const IconComponent = icon;
2481
- return <IconComponent className="w-5 h-5" />;
2482
- })()}
2483
- </span>
2484
- </div>
2485
- <div className="plugins-game-card-body">
2486
- <div className="plugins-game-card-name">{p.name}</div>
2487
- <div className="plugins-game-card-meta">
2488
- <span
2489
- className={`plugins-game-badge ${p.enabled ? "is-on" : "is-off"
2490
- }`}
2491
- >
2492
- {p.enabled ? "ON" : "OFF"}
2493
- </span>
2494
- </div>
2495
- </div>
2496
- </button>
2497
- ))
2498
- )}
2499
- </div>
2500
- </div>
2501
- <div
2502
- className={`plugins-game-detail-panel${gameNarrow && !gameMobileDetail ? " is-hidden" : ""
2503
- }`}
2504
- >
2505
- {selectedPlugin ? (
2506
- <>
2507
- <div className="plugins-game-detail-head">
2508
- {gameNarrow && (
2509
- <button
2510
- type="button"
2511
- className="plugins-game-back-btn"
2512
- onClick={() => setGameMobileDetail(false)}
2513
- >
2514
- {t("pluginsview.Back")}
2515
- </button>
2516
- )}
2517
- <div className="plugins-game-detail-title-row">
2518
- <div className="plugins-game-detail-icon-shell">
2519
- <span className="plugins-game-detail-icon">
2520
- {(() => {
2521
- const icon = resolveIcon(selectedPlugin);
2522
- if (!icon) return "🧩";
2523
- if (typeof icon === "string") {
2524
- const imageSrc = iconImageSource(icon);
2525
- return imageSrc ? (
2526
- <img
2527
- src={imageSrc}
2528
- alt=""
2529
- className="plugins-game-detail-icon"
2530
- />
2531
- ) : (
2532
- icon
2533
- );
2534
- }
2535
- const IconComponent = icon;
2536
- return <IconComponent className="w-6 h-6" />;
2537
- })()}
2538
- </span>
2539
- </div>
2540
- <div className="plugins-game-detail-main">
2541
- <div className="plugins-game-detail-name">
2542
- {selectedPlugin.name}
2543
- </div>
2544
- {selectedPlugin.version && (
2545
- <span className="plugins-game-version">
2546
- v{selectedPlugin.version}
2547
- </span>
2548
- )}
2549
- </div>
2550
- <button
2551
- type="button"
2552
- className={`plugins-game-toggle ${selectedPlugin.enabled ? "is-on" : "is-off"
2553
- }`}
2554
- onClick={() =>
2555
- void handleTogglePlugin(
2556
- selectedPlugin.id,
2557
- !selectedPlugin.enabled,
2558
- )
2559
- }
2560
- disabled={togglingPlugins.has(selectedPlugin.id)}
2561
- >
2562
- {selectedPlugin.enabled ? "ON" : "OFF"}
2563
- </button>
2564
- </div>
2565
- </div>
2566
- <div className="plugins-game-detail-description">
2567
- {selectedPlugin.description}
2568
- </div>
2569
- {(selectedPlugin.tags?.length ?? 0) > 0 && (
2570
- <div className="flex flex-wrap gap-1.5 px-3 pb-3">
2571
- {selectedPlugin.tags?.map((tag) => (
2572
- <span
2573
- key={`${selectedPlugin.id}:${tag}`}
2574
- className="text-[10px] px-1.5 py-px border border-border bg-black/10 text-muted lowercase tracking-wide whitespace-nowrap"
2575
- >
2576
- {tag}
2577
- </span>
2578
- ))}
2579
- </div>
2580
- )}
2581
- {selectedPluginLinks.length > 0 && (
2582
- <div className="plugins-game-detail-links flex flex-wrap gap-2 px-3 pb-3">
2583
- {selectedPluginLinks.map((link) => (
2584
- <button
2585
- key={`${selectedPlugin.id}:${link.key}`}
2586
- type="button"
2587
- className="plugins-game-link-btn border border-border bg-transparent px-2.5 py-1 text-[11px] text-muted transition-colors hover:border-accent hover:text-txt"
2588
- onClick={() => {
2589
- void handleOpenPluginExternalUrl(link.url);
2590
- }}
2591
- >
2592
- {link.label}
2593
- </button>
2594
- ))}
2595
- </div>
2596
- )}
2597
- {selectedPlugin.parameters &&
2598
- selectedPlugin.parameters.length > 0 && (
2599
- <div className="plugins-game-detail-config">
2600
- {selectedPlugin.parameters.map((param: PluginParamDef) => (
2601
- <div key={param.key} id={`field-${param.key}`}>
2602
- <label
2603
- htmlFor={`input-${param.key}`}
2604
- className="text-[11px] tracking-wider text-muted block mb-1"
2605
- >
2606
- {param.key}
2607
- </label>
2608
- <input
2609
- id={`input-${param.key}`}
2610
- type={param.sensitive ? "password" : "text"}
2611
- className="w-full px-2 py-1 text-[12px]"
2612
- placeholder={param.description}
2613
- value={
2614
- pluginConfigs[selectedPlugin.id]?.[param.key] ??
2615
- param.currentValue ??
2616
- ""
2617
- }
2618
- onChange={(e) =>
2619
- handleParamChange(
2620
- selectedPlugin.id,
2621
- param.key,
2622
- e.target.value,
2623
- )
2624
- }
2625
- />
2626
- </div>
2627
- ))}
2628
- </div>
2629
- )}
2630
- <div className="plugins-game-detail-actions">
2631
- <button
2632
- type="button"
2633
- className="plugins-game-action-btn"
2634
- onClick={() => void handleTestConnection(selectedPlugin.id)}
2635
- >
2636
- {t("pluginsview.TestConnection")}
2637
- </button>
2638
- <button
2639
- type="button"
2640
- className={`plugins-game-action-btn plugins-game-save-btn${pluginSaveSuccess.has(selectedPlugin.id) ? " is-saved" : ""
2641
- }`}
2642
- onClick={() => void handleConfigSave(selectedPlugin.id)}
2643
- disabled={pluginSaving.has(selectedPlugin.id)}
2644
- >
2645
- {pluginSaving.has(selectedPlugin.id)
2646
- ? "Saving..."
2647
- : pluginSaveSuccess.has(selectedPlugin.id)
2648
- ? "Saved!"
2649
- : "Save"}
2650
- </button>
2651
- </div>
2652
- </>
2653
- ) : (
2654
- <div className="plugins-game-detail-empty">
2655
- <span className="plugins-game-detail-empty-icon">🧩</span>
2656
- <span className="plugins-game-detail-empty-text">
2657
- {t("pluginsview.SelectA")}{" "}
2658
- {isConnectorLikeMode ? "connector" : "plugin"}{" "}
2659
- {t("pluginsview.toC")}
2660
- </span>
2661
- </div>
2662
- )}
2663
- </div>
2664
- </div>
2665
- );
2666
- }
2667
-
2668
- // ── Main render ────────────────────────────────────────────────────
2669
-
2670
- return (
2671
- <div
2672
- data-testid={mode === "social" ? "plugins-view-social" : undefined}
2673
- className={`relative min-h-0 ${showDesktopSubgroupSidebar ? "md:pl-[18rem]" : ""}`}
2674
- >
2675
- {showDesktopSubgroupSidebar && (
2676
- <aside
2677
- className="hidden md:absolute md:left-0 md:top-0 md:block md:w-64"
2678
- data-testid="plugins-subgroup-sidebar"
2679
- >
2680
- <div className="sticky top-0 rounded-[28px] border border-border/50 bg-bg/35 p-5 backdrop-blur-xl shadow-sm">
2681
- <div className="mb-4 text-[11px] font-semibold uppercase tracking-[0.18em] text-muted/80">
2682
- Plugin Types
2683
- </div>
2684
- <nav className="flex flex-col gap-2">
2685
- {subgroupTags.map((tag) =>
2686
- renderSubgroupFilterButton(tag, { sidebar: true }),
2687
- )}
2688
- </nav>
2689
- </div>
2690
- </aside>
2691
- )}
2692
-
2693
- <div className="min-w-0">
2694
- {showToolbar && (
2695
- <div className="flex items-center gap-3 mb-4 flex-wrap">
2696
- <div className="relative flex-1 min-w-[220px]">
2697
- <Input
2698
- type="text"
2699
- name="plugin-search"
2700
- autoComplete="off"
2701
- data-1p-ignore
2702
- data-lpignore="true"
2703
- className="w-full bg-card/60 backdrop-blur-md shadow-inner pr-8 h-9 rounded-xl focus-visible:ring-accent border-border/40"
2704
- placeholder={searchPlaceholder}
2705
- value={pluginSearch}
2706
- onChange={(e) => setState("pluginSearch", e.target.value)}
2707
- />
2708
- {pluginSearch && (
2709
- <Button
2710
- variant="ghost"
2711
- size="icon"
2712
- className="absolute right-1 top-1/2 -translate-y-1/2 w-6 h-6 text-muted hover:text-txt rounded-full"
2713
- onClick={() => setState("pluginSearch", "")}
2714
- title={t("pluginsview.ClearSearch")}
2715
- >
2716
-
2717
- </Button>
2718
- )}
2719
- </div>
2720
-
2721
- <div className="flex gap-1.5 shrink-0 bg-black/10 p-1 rounded-xl border border-white/5">
2722
- {(["all", "enabled"] as const).map((s) => (
2723
- <Button
2724
- key={s}
2725
- variant={pluginStatusFilter === s ? "default" : "ghost"}
2726
- size="sm"
2727
- className={`h-7 px-3 text-[11px] font-bold tracking-wide rounded-lg transition-all ${pluginStatusFilter === s
2728
- ? "shadow-sm"
2729
- : "text-muted hover:text-txt hover:bg-white/5"
2730
- }`}
2731
- onClick={() =>
2732
- setState("pluginStatusFilter", s as StatusFilter)
2733
- }
2734
- >
2735
- {s === "all"
2736
- ? `All (${categoryPlugins.length})`
2737
- : `Enabled (${enabledCount})`}
2738
- </Button>
2739
- ))}
2740
- </div>
2741
-
2742
- {allowCustomOrder && pluginOrder.length > 0 && (
2743
- <Button
2744
- variant="outline"
2745
- size="sm"
2746
- className="h-8 px-3 text-[11px] font-bold border-border/40 bg-card/40 backdrop-blur-md shadow-sm rounded-xl shrink-0"
2747
- onClick={handleResetOrder}
2748
- title={t("pluginsview.ResetToDefaultSor")}
2749
- >
2750
- {t("pluginsview.ResetOrder")}
2751
- </Button>
2752
- )}
2753
-
2754
- {showPluginManagementActions && (
2755
- <Button
2756
- variant="secondary"
2757
- size="sm"
2758
- className="h-8 px-4 text-[11px] font-bold tracking-wide border border-accent/30 text-txt bg-accent/10 hover:bg-accent/20 hover:border-accent/50 shadow-sm rounded-xl shrink-0 transition-all"
2759
- onClick={() => setAddDirOpen(true)}
2760
- >
2761
- {t("pluginsview.AddPlugin")}
2762
- </Button>
2763
- )}
2764
- </div>
2765
- )}
2766
-
2767
- {hasPluginToggleInFlight && (
2768
- <div className="mb-3 px-3 py-2 border border-accent bg-accent-subtle text-[11px] text-txt">
2769
- {t("pluginsview.ApplyingPluginChan")}
2770
- </div>
2771
- )}
2772
-
2773
- {showSubgroupFilters && (
2774
- <div
2775
- className="flex items-center gap-2 mb-5 flex-wrap md:hidden"
2776
- data-testid="plugins-subgroup-chips"
2777
- >
2778
- {subgroupTags.map((tag) => renderSubgroupFilterButton(tag))}
2779
- </div>
2780
- )}
2781
-
2782
- {/* Plugin grid */}
2783
- <div className="overflow-y-auto">
2784
- {sorted.length === 0 ? (
2785
- <div className="text-center py-10 px-5 text-muted border border-dashed border-border">
2786
- {effectiveSearch
2787
- ? `No ${resultLabel} match your search.`
2788
- : `No ${resultLabel} available.`}
2789
- </div>
2790
- ) : visiblePlugins.length === 0 ? (
2791
- <div className="text-center py-10 px-5 text-muted border border-dashed border-border">
2792
- {showSubgroupFilters
2793
- ? "No plugins match this tag filter."
2794
- : `No ${resultLabel} match your filters.`}
2795
- </div>
2796
- ) : (
2797
- renderPluginGrid(visiblePlugins)
2798
- )}
2799
- </div>
2800
- </div>
2801
-
2802
- {/* Settings dialog */}
2803
- {settingsDialogPlugin &&
2804
- (() => {
2805
- const p = settingsDialogPlugin;
2806
- const isShowcase = p.id === "__ui-showcase__";
2807
- const isSaving = pluginSaving.has(p.id);
2808
- const saveSuccess = pluginSaveSuccess.has(p.id);
2809
- const categoryLabel = isShowcase
2810
- ? "showcase"
2811
- : p.category === "ai-provider"
2812
- ? "ai provider"
2813
- : p.category;
2814
- return (
2815
- <div
2816
- className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-6 animate-in fade-in duration-200"
2817
- onClick={(e) => {
2818
- if (e.target === e.currentTarget) toggleSettings(p.id);
2819
- }}
2820
- onKeyDown={(e) => {
2821
- if (e.key === "Escape" || e.key === "Enter" || e.key === " ") {
2822
- e.preventDefault();
2823
- toggleSettings(p.id);
2824
- }
2825
- }}
2826
- role="dialog"
2827
- aria-modal="true"
2828
- >
2829
- <div className="w-full max-w-2xl max-h-[85vh] border border-border/50 bg-card/90 shadow-2xl flex flex-col overflow-hidden rounded-2xl backdrop-blur-xl">
2830
- {/* Dialog header */}
2831
- <div className="flex items-center gap-3 px-5 py-4 border-b border-border/30 bg-black/10 shrink-0">
2832
- <span className="font-bold text-base flex items-center gap-2 flex-1 min-w-0 tracking-wide text-txt">
2833
- {(() => {
2834
- const icon = resolveIcon(p);
2835
- if (!icon) return null;
2836
- if (typeof icon === "string") {
2837
- const imageSrc = iconImageSource(icon);
2838
- return imageSrc ? (
2839
- <img
2840
- src={imageSrc}
2841
- alt=""
2842
- className="w-6 h-6 rounded-md object-contain"
2843
- onError={(e) => {
2844
- (
2845
- e.currentTarget as HTMLImageElement
2846
- ).style.display = "none";
2847
- }}
2848
- />
2849
- ) : (
2850
- <span className="text-base">{icon}</span>
2851
- );
2852
- }
2853
- const IconComponent = icon;
2854
- return <IconComponent className="w-6 h-6 text-txt" />;
2855
- })()}
2856
- {p.name}
2857
- </span>
2858
- <span className="text-[10px] px-2 py-0.5 rounded-full border border-border/40 bg-black/20 text-muted lowercase tracking-widest font-bold">
2859
- {categoryLabel}
2860
- </span>
2861
- {p.version && (
2862
- <span className="text-[10px] font-mono text-muted/70">
2863
- v{p.version}
2864
- </span>
2865
- )}
2866
- {isShowcase && (
2867
- <span className="text-[10px] font-bold tracking-widest px-2.5 py-[2px] border border-accent/30 text-txt bg-accent/10 rounded-full">
2868
- {t("pluginsview.DEMO")}
2869
- </span>
2870
- )}
2871
- <Button
2872
- variant="ghost"
2873
- size="icon"
2874
- className="h-8 w-8 text-muted hover:bg-white/10 hover:text-txt rounded-full transition-all shrink-0 ml-2"
2875
- onClick={() => toggleSettings(p.id)}
2876
- >
2877
-
2878
- </Button>
2879
- </div>
2880
-
2881
- {/* Dialog body — scrollable */}
2882
- <div className="overflow-y-auto flex-1 scrollbar-thin scrollbar-thumb-white/10 scrollbar-track-transparent">
2883
- {/* Plugin details */}
2884
- <div className="px-5 pt-4 pb-1 flex items-center gap-3 flex-wrap text-xs text-muted">
2885
- {p.description && (
2886
- <span className="text-[12px] text-muted leading-relaxed">
2887
- {p.description}
2888
- </span>
2889
- )}
2890
- {(p.tags?.length ?? 0) > 0 && (
2891
- <span className="flex items-center gap-1.5 flex-wrap">
2892
- {p.tags?.map((tag) => (
2893
- <span
2894
- key={`${p.id}:${tag}:settings`}
2895
- className="text-[10px] px-1.5 py-px border border-border/40 bg-black/10 text-muted lowercase tracking-wide whitespace-nowrap"
2896
- >
2897
- {tag}
2898
- </span>
2899
- ))}
2900
- </span>
2901
- )}
2902
- </div>
2903
- {(p.npmName || (p.pluginDeps && p.pluginDeps.length > 0)) && (
2904
- <div className="px-5 pb-2 flex items-center gap-3 flex-wrap">
2905
- {p.npmName && (
2906
- <span className="font-mono text-[10px] text-muted opacity-50">
2907
- {p.npmName}
2908
- </span>
2909
- )}
2910
- {p.pluginDeps && p.pluginDeps.length > 0 && (
2911
- <span className="flex items-center gap-1 flex-wrap">
2912
- <span className="text-[10px] text-muted opacity-60">
2913
- {t("pluginsview.dependsOn")}
2914
- </span>
2915
- {p.pluginDeps.map((dep: string) => (
2916
- <span
2917
- key={dep}
2918
- className="text-[10px] px-1.5 py-px border border-border bg-accent-subtle text-muted rounded-sm"
2919
- >
2920
- {dep}
2921
- </span>
2922
- ))}
2923
- </span>
2924
- )}
2925
- </div>
2926
- )}
2927
-
2928
- <div className="px-5 py-3">
2929
- <PluginConfigForm
2930
- plugin={p}
2931
- pluginConfigs={pluginConfigs}
2932
- onParamChange={handleParamChange}
2933
- />
2934
- {p.id === "whatsapp" && (
2935
- <WhatsAppQrOverlay accountId="default" />
2936
- )}
2937
- </div>
2938
- </div>
2939
-
2940
- {/* Dialog footer — actions (hidden for showcase) */}
2941
- {!isShowcase && (
2942
- <div className="flex justify-end gap-3 px-5 py-4 border-t border-border/30 shrink-0 bg-black/10">
2943
- {p.enabled && !p.isActive && p.npmName && !p.loadError && (
2944
- <Button
2945
- variant="default"
2946
- size="sm"
2947
- className="h-8 px-4 text-[11px] font-bold tracking-wide shadow-sm"
2948
- disabled={installingPlugins.has(p.id)}
2949
- onClick={() =>
2950
- handleInstallPlugin(p.id, p.npmName ?? "")
2951
- }
2952
- >
2953
- {installingPlugins.has(p.id)
2954
- ? installProgress.get(p.npmName ?? "")?.message ||
2955
- "Installing..."
2956
- : "Install Plugin"}
2957
- </Button>
2958
- )}
2959
- {p.loadError && (
2960
- <span
2961
- className="px-3 py-1.5 text-[11px] text-danger font-bold tracking-wide"
2962
- title={p.loadError}
2963
- >
2964
- {t("pluginsview.PackageBrokenMis")}
2965
- </span>
2966
- )}
2967
- {p.isActive && (
2968
- <Button
2969
- variant={
2970
- testResults.get(p.id)?.success
2971
- ? "default"
2972
- : testResults.get(p.id)?.error
2973
- ? "destructive"
2974
- : "outline"
2975
- }
2976
- size="sm"
2977
- className={`h-8 px-4 text-[11px] font-bold tracking-wide transition-all ${testResults.get(p.id)?.loading
2978
- ? "opacity-70 cursor-wait"
2979
- : testResults.get(p.id)?.success
2980
- ? "bg-ok text-ok-fg border-ok hover:bg-ok/90"
2981
- : testResults.get(p.id)?.error
2982
- ? "bg-danger text-danger-fg border-danger hover:bg-danger/90"
2983
- : "border-border/40 bg-card/40 backdrop-blur-md shadow-sm hover:border-accent/40"
2984
- }`}
2985
- disabled={testResults.get(p.id)?.loading}
2986
- onClick={() => handleTestConnection(p.id)}
2987
- >
2988
- {testResults.get(p.id)?.loading
2989
- ? "Testing..."
2990
- : testResults.get(p.id)?.success
2991
- ? `\u2713 OK (${testResults.get(p.id)?.durationMs}ms)`
2992
- : testResults.get(p.id)?.error
2993
- ? `\u2715 ${testResults.get(p.id)?.error}`
2994
- : "Test Connection"}
2995
- </Button>
2996
- )}
2997
- <Button
2998
- variant="ghost"
2999
- size="sm"
3000
- className="h-8 px-4 text-[12px] font-bold text-muted hover:text-txt transition-all"
3001
- onClick={() => handleConfigReset(p.id)}
3002
- >
3003
- {t("pluginsview.Reset")}
3004
- </Button>
3005
- <Button
3006
- variant={saveSuccess ? "default" : "secondary"}
3007
- size="sm"
3008
- className={`h-8 px-5 text-[12px] font-bold tracking-wide transition-all ${saveSuccess
3009
- ? "bg-ok text-ok-fg hover:bg-ok/90"
3010
- : "bg-accent text-accent-fg hover:bg-accent/90 shadow-lg shadow-accent/20"
3011
- }`}
3012
- onClick={() => handleConfigSave(p.id)}
3013
- disabled={isSaving}
3014
- >
3015
- {isSaving
3016
- ? "Saving..."
3017
- : saveSuccess
3018
- ? "\u2713 Saved"
3019
- : "Save Settings"}
3020
- </Button>
3021
- </div>
3022
- )}
3023
- </div>
3024
- </div>
3025
- );
3026
- })()}
3027
-
3028
- {/* Add from directory modal */}
3029
- {addDirOpen && (
3030
- <div
3031
- className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-6 duration-200 animate-in fade-in"
3032
- onClick={(e) => {
3033
- if (e.target === e.currentTarget) {
3034
- setAddDirOpen(false);
3035
- setAddDirPath("");
3036
- }
3037
- }}
3038
- onKeyDown={(e) => {
3039
- if (e.key === "Escape" || e.key === "Enter" || e.key === " ") {
3040
- e.preventDefault();
3041
- setAddDirOpen(false);
3042
- setAddDirPath("");
3043
- }
3044
- }}
3045
- role="dialog"
3046
- aria-modal="true"
3047
- >
3048
- <div className="w-full max-w-md border border-border/50 bg-card/90 backdrop-blur-xl p-6 rounded-2xl shadow-2xl">
3049
- <div className="flex items-center justify-between mb-5">
3050
- <div className="font-bold text-base tracking-wide text-txt">
3051
- {t("pluginsview.AddPlugin1")}
3052
- </div>
3053
- <Button
3054
- variant="ghost"
3055
- size="icon"
3056
- className="h-8 w-8 text-muted hover:bg-white/10 hover:text-txt rounded-full transition-all shrink-0 ml-2"
3057
- onClick={() => {
3058
- setAddDirOpen(false);
3059
- setAddDirPath("");
3060
- }}
3061
- >
3062
-
3063
- </Button>
3064
- </div>
3065
-
3066
- <p className="text-sm font-medium tracking-wide text-muted mb-4">
3067
- {t("pluginsview.EnterThePathToA")}
3068
- </p>
3069
-
3070
- <Input
3071
- type="text"
3072
- className="w-full h-10 px-3 border border-border/40 bg-black/20 text-txt text-[13px] font-mono transition-all duration-150 focus-visible:ring-accent rounded-xl shadow-inner placeholder:text-muted/50"
3073
- placeholder={t("pluginsview.PathToPluginOrP")}
3074
- value={addDirPath}
3075
- onChange={(e) => setAddDirPath(e.target.value)}
3076
- onKeyDown={(e) => {
3077
- if (e.key === "Enter") void handleAddFromDirectory();
3078
- }}
3079
- />
3080
-
3081
- <div className="flex justify-end gap-3 mt-6">
3082
- <Button
3083
- variant="ghost"
3084
- size="sm"
3085
- className="h-8 px-4 text-[12px] font-bold text-muted hover:text-txt transition-all"
3086
- onClick={() => {
3087
- setAddDirOpen(false);
3088
- setAddDirPath("");
3089
- }}
3090
- >
3091
- {t("pluginsview.Cancel")}
3092
- </Button>
3093
- <Button
3094
- variant="default"
3095
- size="sm"
3096
- className="h-8 px-6 text-[12px] font-bold tracking-wide shadow-sm"
3097
- onClick={handleAddFromDirectory}
3098
- disabled={addDirLoading || !addDirPath.trim()}
3099
- >
3100
- {addDirLoading ? "Adding..." : "Add"}
3101
- </Button>
3102
- </div>
3103
- </div>
3104
- </div>
3105
- )}
3106
- </div>
3107
- );
3108
- }
3109
-
3110
- /* ── Exported views ────────────────────────────────────────────────── */
3111
-
3112
- /** Unified plugins view — tag-filtered plugin list. */
3113
- export function PluginsView({
3114
- mode = "all",
3115
- inModal,
3116
- }: {
3117
- mode?: PluginsViewMode;
3118
- inModal?: boolean;
3119
- }) {
3120
- const label =
3121
- mode === "social"
3122
- ? "Connectors"
3123
- : mode === "connectors"
3124
- ? "Connectors"
3125
- : mode === "streaming"
3126
- ? "Streaming"
3127
- : "Plugins";
3128
- return <PluginListView label={label} mode={mode} inModal={inModal} />;
3129
- }