@elizaos/app-core 2.0.0-alpha.13 → 2.0.0-alpha.15

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 (125) hide show
  1. package/.turbo/turbo-build.log +0 -1
  2. package/dist/App.d.ts.map +1 -1
  3. package/dist/App.js +26 -12
  4. package/dist/api/client.d.ts +3 -3
  5. package/dist/api/client.d.ts.map +1 -1
  6. package/dist/api/client.js +24 -13
  7. package/dist/bridge/plugin-bridge.d.ts.map +1 -1
  8. package/dist/components/AvatarLoader.d.ts +3 -1
  9. package/dist/components/AvatarLoader.d.ts.map +1 -1
  10. package/dist/components/AvatarLoader.js +4 -1
  11. package/dist/components/BscTradePanel.d.ts +1 -1
  12. package/dist/components/BscTradePanel.d.ts.map +1 -1
  13. package/dist/components/CharacterView.d.ts.map +1 -1
  14. package/dist/components/CharacterView.js +50 -15
  15. package/dist/components/ChatView.js +1 -1
  16. package/dist/components/ConfigPageView.d.ts.map +1 -1
  17. package/dist/components/ConfigPageView.js +9 -8
  18. package/dist/components/ConversationsSidebar.js +1 -1
  19. package/dist/components/CustomActionEditor.js +1 -1
  20. package/dist/components/FineTuningView.d.ts.map +1 -1
  21. package/dist/components/FineTuningView.js +2 -2
  22. package/dist/components/GlobalEmoteOverlay.d.ts.map +1 -1
  23. package/dist/components/GlobalEmoteOverlay.js +1 -1
  24. package/dist/components/HeartbeatsView.js +1 -1
  25. package/dist/components/LoadingScreen.d.ts.map +1 -1
  26. package/dist/components/LoadingScreen.js +38 -7
  27. package/dist/components/OnboardingWizard.js +1 -1
  28. package/dist/components/PluginsView.d.ts.map +1 -1
  29. package/dist/components/PluginsView.js +4 -1
  30. package/dist/components/ShellOverlays.js +1 -1
  31. package/dist/components/VoiceConfigView.d.ts.map +1 -1
  32. package/dist/components/VoiceConfigView.js +4 -2
  33. package/dist/components/avatar/VrmEngine.d.ts +2 -0
  34. package/dist/components/avatar/VrmEngine.d.ts.map +1 -1
  35. package/dist/components/avatar/VrmEngine.js +14 -6
  36. package/dist/components/companion/CompanionSceneHost.d.ts +1 -1
  37. package/dist/components/companion/CompanionSceneHost.d.ts.map +1 -1
  38. package/dist/components/companion/CompanionSceneHost.js +1 -1
  39. package/dist/components/index.d.ts +10 -10
  40. package/dist/components/index.d.ts.map +1 -1
  41. package/dist/components/index.js +10 -10
  42. package/dist/components/inventory/TokensTable.js +2 -2
  43. package/dist/components/onboarding/IdentityStep.d.ts.map +1 -1
  44. package/dist/components/onboarding/IdentityStep.js +1 -1
  45. package/dist/components/shared/ShellHeaderControls.js +1 -1
  46. package/dist/config/config-field.d.ts.map +1 -1
  47. package/dist/config/config-field.js +7 -8
  48. package/dist/config/index.d.ts +1 -1
  49. package/dist/config/index.d.ts.map +1 -1
  50. package/dist/config/index.js +1 -1
  51. package/dist/hooks/useVoiceChat.d.ts.map +1 -1
  52. package/dist/hooks/useVoiceChat.js +3 -1
  53. package/dist/i18n/locales/en.json +1192 -1192
  54. package/dist/i18n/locales/es.json +1192 -1192
  55. package/dist/i18n/locales/ko.json +1192 -1192
  56. package/dist/i18n/locales/pt.json +1192 -1192
  57. package/dist/i18n/locales/zh-CN.json +1192 -1192
  58. package/dist/package.json +181 -0
  59. package/dist/platform/lifo.d.ts.map +1 -1
  60. package/dist/platform/lifo.js +4 -1
  61. package/dist/state/AppContext.d.ts.map +1 -1
  62. package/dist/state/AppContext.js +23 -6
  63. package/dist/state/internal.d.ts +1 -1
  64. package/dist/state/internal.d.ts.map +1 -1
  65. package/dist/state/internal.js +1 -1
  66. package/dist/state/parsers.d.ts.map +1 -1
  67. package/dist/state/parsers.js +3 -2
  68. package/dist/state/persistence.js +1 -1
  69. package/dist/styles/anime.css +6324 -0
  70. package/dist/styles/base.css +196 -0
  71. package/dist/styles/onboarding-game.css +738 -0
  72. package/dist/styles/styles.css +2087 -0
  73. package/dist/styles/xterm.css +241 -0
  74. package/package.json +4 -4
  75. package/src/App.tsx +35 -14
  76. package/src/ambient.d.ts +5 -5
  77. package/src/api/client.ts +36 -23
  78. package/src/bridge/plugin-bridge.ts +1 -1
  79. package/src/components/AvatarLoader.tsx +6 -0
  80. package/src/components/BscTradePanel.tsx +1 -1
  81. package/src/components/CharacterView.tsx +536 -367
  82. package/src/components/ChatView.tsx +3 -3
  83. package/src/components/ConfigPageView.tsx +9 -8
  84. package/src/components/ConversationsSidebar.tsx +1 -1
  85. package/src/components/CustomActionEditor.tsx +6 -6
  86. package/src/components/FineTuningView.tsx +6 -3
  87. package/src/components/GlobalEmoteOverlay.tsx +1 -4
  88. package/src/components/HeartbeatsView.tsx +1 -1
  89. package/src/components/InventoryView.tsx +2 -2
  90. package/src/components/LoadingScreen.tsx +39 -6
  91. package/src/components/OnboardingWizard.tsx +1 -1
  92. package/src/components/PluginsView.tsx +6 -0
  93. package/src/components/ShellOverlays.tsx +1 -1
  94. package/src/components/VoiceConfigView.tsx +4 -5
  95. package/src/components/avatar/VrmEngine.ts +25 -7
  96. package/src/components/companion/CompanionSceneHost.tsx +5 -1
  97. package/src/components/index.ts +10 -10
  98. package/src/components/inventory/TokensTable.tsx +2 -2
  99. package/src/components/onboarding/IdentityStep.tsx +9 -13
  100. package/src/components/shared/ShellHeaderControls.tsx +1 -1
  101. package/src/config/config-field.tsx +7 -8
  102. package/src/config/index.ts +3 -3
  103. package/src/hooks/useVoiceChat.ts +5 -3
  104. package/src/platform/lifo.ts +14 -4
  105. package/src/state/AppContext.tsx +24 -1
  106. package/src/state/internal.ts +6 -6
  107. package/src/state/parsers.ts +4 -3
  108. package/src/state/persistence.ts +1 -1
  109. package/test/app/MessageContent.test.tsx +42 -0
  110. package/test/app/bug-report-modal.test.tsx +3 -3
  111. package/test/app/chat-view.test.tsx +3 -3
  112. package/test/app/cloud-login-lock.test.ts +3 -2
  113. package/test/app/custom-actions-smoke.test.ts +3 -3
  114. package/test/app/onboarding-language.test.tsx +3 -3
  115. package/test/app/pages-navigation-smoke.e2e.test.ts +13 -8
  116. package/test/app/plugin-bridge.test.ts +1 -1
  117. package/test/app/provider-dropdown-default.test.tsx +2 -4
  118. package/test/app/restart-banner.test.tsx +3 -3
  119. package/test/app/shell-mode-switching.e2e.test.ts +6 -6
  120. package/test/app/shell-mode-tab-memory.test.tsx +1 -1
  121. package/test/app/startup-chat.e2e.test.ts +3 -3
  122. package/test/app/triggers-view.e2e.test.ts +3 -2
  123. package/test/app/wallet-api-save-lock.test.ts +2 -1
  124. package/test/utils/assistant-text.test.ts +64 -0
  125. package/test/utils/streaming-text.test.ts +89 -0
@@ -0,0 +1,241 @@
1
+ /**
2
+ * Copyright (c) 2014 The xterm.js authors. All rights reserved.
3
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
4
+ * https://github.com/chjj/term.js
5
+ * @license MIT
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ *
25
+ * Originally forked from (with the author's permission):
26
+ * Fabrice Bellard's javascript vt100 for jslinux:
27
+ * http://bellard.org/jslinux/
28
+ * Copyright (c) 2011 Fabrice Bellard
29
+ * The original design remains. The terminal itself
30
+ * has been extended to include xterm CSI codes, among
31
+ * other features.
32
+ */
33
+
34
+ /**
35
+ * Default styles for xterm.js
36
+ */
37
+
38
+ .xterm {
39
+ cursor: text;
40
+ position: relative;
41
+ user-select: none;
42
+ -ms-user-select: none;
43
+ -webkit-user-select: none;
44
+ }
45
+
46
+ .xterm.focus,
47
+ .xterm:focus {
48
+ outline: none;
49
+ }
50
+
51
+ .xterm .xterm-helpers {
52
+ position: absolute;
53
+ top: 0;
54
+ /**
55
+ * The z-index of the helpers must be higher than the canvases in order for
56
+ * IMEs to appear on top.
57
+ */
58
+ z-index: 5;
59
+ }
60
+
61
+ .xterm .xterm-helper-textarea {
62
+ padding: 0;
63
+ border: 0;
64
+ margin: 0;
65
+ /* Move textarea out of the screen to the far left, so that the cursor is not visible */
66
+ position: absolute;
67
+ opacity: 0;
68
+ left: -9999em;
69
+ top: 0;
70
+ width: 0;
71
+ height: 0;
72
+ z-index: -5;
73
+ /** Prevent wrapping so the IME appears against the textarea at the correct position */
74
+ white-space: nowrap;
75
+ overflow: hidden;
76
+ resize: none;
77
+ }
78
+
79
+ .xterm .composition-view {
80
+ /* TODO: Composition position got messed up somewhere */
81
+ background: #000;
82
+ color: #fff;
83
+ display: none;
84
+ position: absolute;
85
+ white-space: nowrap;
86
+ z-index: 1;
87
+ }
88
+
89
+ .xterm .composition-view.active {
90
+ display: block;
91
+ }
92
+
93
+ .xterm .xterm-viewport {
94
+ /* On OS X this is required in order for the scroll bar to appear fully opaque */
95
+ background-color: #000;
96
+ overflow-y: scroll;
97
+ cursor: default;
98
+ position: absolute;
99
+ right: 0;
100
+ left: 0;
101
+ top: 0;
102
+ bottom: 0;
103
+ }
104
+
105
+ .xterm .xterm-screen {
106
+ position: relative;
107
+ }
108
+
109
+ .xterm .xterm-screen canvas {
110
+ position: absolute;
111
+ left: 0;
112
+ top: 0;
113
+ }
114
+
115
+ .xterm .xterm-scroll-area {
116
+ visibility: hidden;
117
+ }
118
+
119
+ .xterm-char-measure-element {
120
+ display: inline-block;
121
+ visibility: hidden;
122
+ position: absolute;
123
+ top: 0;
124
+ left: -9999em;
125
+ line-height: normal;
126
+ }
127
+
128
+ .xterm.enable-mouse-events {
129
+ /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
130
+ cursor: default;
131
+ }
132
+
133
+ .xterm.xterm-cursor-pointer,
134
+ .xterm .xterm-cursor-pointer {
135
+ cursor: pointer;
136
+ }
137
+
138
+ .xterm.column-select.focus {
139
+ /* Column selection mode */
140
+ cursor: crosshair;
141
+ }
142
+
143
+ .xterm .xterm-accessibility:not(.debug),
144
+ .xterm .xterm-message {
145
+ position: absolute;
146
+ left: 0;
147
+ top: 0;
148
+ bottom: 0;
149
+ right: 0;
150
+ z-index: 10;
151
+ color: transparent;
152
+ pointer-events: none;
153
+ }
154
+
155
+ .xterm .xterm-accessibility-tree:not(.debug) *::selection {
156
+ color: transparent;
157
+ }
158
+
159
+ .xterm .xterm-accessibility-tree {
160
+ user-select: text;
161
+ white-space: pre;
162
+ }
163
+
164
+ .xterm .live-region {
165
+ position: absolute;
166
+ left: -9999px;
167
+ width: 1px;
168
+ height: 1px;
169
+ overflow: hidden;
170
+ }
171
+
172
+ .xterm-dim {
173
+ /* Dim should not apply to background, so the opacity of the foreground color is applied
174
+ * explicitly in the generated class and reset to 1 here */
175
+ /* biome-ignore lint/complexity/noImportantStyles: required by xterm.js dim rendering */
176
+ opacity: 1 !important;
177
+ }
178
+
179
+ .xterm-underline-1 {
180
+ text-decoration: underline;
181
+ }
182
+ .xterm-underline-2 {
183
+ text-decoration: double underline;
184
+ }
185
+ .xterm-underline-3 {
186
+ text-decoration: wavy underline;
187
+ }
188
+ .xterm-underline-4 {
189
+ text-decoration: dotted underline;
190
+ }
191
+ .xterm-underline-5 {
192
+ text-decoration: dashed underline;
193
+ }
194
+
195
+ .xterm-overline {
196
+ text-decoration: overline;
197
+ }
198
+
199
+ .xterm-overline.xterm-underline-1 {
200
+ text-decoration: overline underline;
201
+ }
202
+ .xterm-overline.xterm-underline-2 {
203
+ text-decoration: overline double underline;
204
+ }
205
+ .xterm-overline.xterm-underline-3 {
206
+ text-decoration: overline wavy underline;
207
+ }
208
+ .xterm-overline.xterm-underline-4 {
209
+ text-decoration: overline dotted underline;
210
+ }
211
+ .xterm-overline.xterm-underline-5 {
212
+ text-decoration: overline dashed underline;
213
+ }
214
+
215
+ .xterm-strikethrough {
216
+ text-decoration: line-through;
217
+ }
218
+
219
+ .xterm-screen .xterm-decoration-container .xterm-decoration {
220
+ z-index: 6;
221
+ position: absolute;
222
+ }
223
+
224
+ .xterm-screen
225
+ .xterm-decoration-container
226
+ .xterm-decoration.xterm-decoration-top-layer {
227
+ z-index: 7;
228
+ }
229
+
230
+ .xterm-decoration-overview-ruler {
231
+ z-index: 8;
232
+ position: absolute;
233
+ top: 0;
234
+ right: 0;
235
+ pointer-events: none;
236
+ }
237
+
238
+ .xterm-decoration-top {
239
+ z-index: 2;
240
+ position: relative;
241
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/app-core",
3
- "version": "2.0.0-alpha.13",
3
+ "version": "2.0.0-alpha.15",
4
4
  "description": "Shared application core for elizaOS shells and white-label apps.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -67,8 +67,8 @@
67
67
  "@capacitor/haptics": "8.0.0",
68
68
  "@capacitor/keyboard": "8.0.0",
69
69
  "@capacitor/preferences": "^8.0.1",
70
- "@elizaos/autonomous": "2.0.0-alpha.13",
71
- "@elizaos/ui": "2.0.0-alpha.13",
70
+ "@elizaos/autonomous": "2.0.0-alpha.15",
71
+ "@elizaos/ui": "2.0.0-alpha.15",
72
72
  "@lifo-sh/core": "0.4.4",
73
73
  "@lifo-sh/ui": "0.4.2",
74
74
  "@pixiv/three-vrm": "^3.4.5",
@@ -86,5 +86,5 @@
86
86
  "@types/three": "^0.182.0",
87
87
  "typescript": "^5.9.3"
88
88
  },
89
- "gitHead": "9448dcfc32d38873e1e2596d4ff4eca444fadca0"
89
+ "gitHead": "64c3776b97ecd672df468fc872a36822c8edcc51"
90
90
  }
package/src/App.tsx CHANGED
@@ -3,23 +3,25 @@
3
3
  */
4
4
 
5
5
  import { Keyboard } from "@capacitor/keyboard";
6
+ import { isIOS, isLifoPopoutValue, isNative } from "@elizaos/app-core/platform";
7
+ import { type ReactNode, useCallback, useEffect, useRef, useState } from "react";
6
8
  import {
7
9
  AdvancedPageView,
8
10
  AppsPageView,
9
11
  AvatarLoader,
10
12
  CharacterView,
11
13
  ChatView,
12
- ConnectionFailedBanner,
13
- ConversationsSidebar,
14
- ConnectorsPageView,
15
14
  CompanionShell,
16
15
  CompanionView,
16
+ ConnectionFailedBanner,
17
+ ConnectorsPageView,
18
+ ConversationsSidebar,
17
19
  CustomActionEditor,
18
20
  CustomActionsPanel,
19
21
  ErrorBoundary,
20
22
  GameViewOverlay,
21
- HeartbeatsView,
22
23
  Header,
24
+ HeartbeatsView,
23
25
  InventoryView,
24
26
  KnowledgeView,
25
27
  OnboardingWizard,
@@ -40,9 +42,7 @@ import {
40
42
  } from "./hooks";
41
43
  import type { Tab } from "./navigation";
42
44
  import { APPS_ENABLED, COMPANION_ENABLED } from "./navigation";
43
- import { isIOS, isLifoPopoutValue, isNative } from "@elizaos/app-core/platform";
44
45
  import { useApp } from "./state";
45
- import { type ReactNode, useCallback, useEffect, useState } from "react";
46
46
 
47
47
  const CHAT_MOBILE_BREAKPOINT_PX = 1024;
48
48
 
@@ -358,15 +358,29 @@ export function App() {
358
358
  return <StartupFailureView error={startupError} onRetry={retryStartup} />;
359
359
  }
360
360
 
361
- if (onboardingLoading || agentStarting) {
362
- const loadingLabel = agentStarting
363
- ? "Initializing agent"
364
- : "Starting systems";
365
- return <AvatarLoader label={loadingLabel} fullScreen />;
366
- }
361
+ const shouldLoad = onboardingLoading || agentStarting;
362
+ const [loaderFadingOut, setLoaderFadingOut] = useState(false);
363
+ const showLoaderRef = useRef(true);
364
+ const [showLoader, setShowLoader] = useState(true);
367
365
 
368
- if (authRequired) return <PairingView />;
369
- if (!onboardingComplete) return <OnboardingWizard />;
366
+ useEffect(() => {
367
+ if (shouldLoad) {
368
+ showLoaderRef.current = true;
369
+ setShowLoader(true);
370
+ setLoaderFadingOut(false);
371
+ } else if (showLoaderRef.current) {
372
+ showLoaderRef.current = false;
373
+ setLoaderFadingOut(true);
374
+ const timer = setTimeout(() => {
375
+ setShowLoader(false);
376
+ setLoaderFadingOut(false);
377
+ }, 800);
378
+ return () => clearTimeout(timer);
379
+ }
380
+ }, [shouldLoad]);
381
+
382
+ if (authRequired && !shouldLoad) return <PairingView />;
383
+ if (!onboardingComplete && !shouldLoad) return <OnboardingWizard />;
370
384
 
371
385
  const shellContent = companionShellVisible ? (
372
386
  <CompanionShell tab={effectiveTab} actionNotice={actionNotice} />
@@ -467,6 +481,13 @@ export function App() {
467
481
  />
468
482
  <ConnectionFailedBanner />
469
483
  <SystemWarningBanner />
484
+ {showLoader && (
485
+ <AvatarLoader
486
+ label={agentStarting ? "Initializing agent" : "Starting systems"}
487
+ fullScreen
488
+ fadingOut={loaderFadingOut}
489
+ />
490
+ )}
470
491
  </BugReportProvider>
471
492
  );
472
493
  }
package/src/ambient.d.ts CHANGED
@@ -5,12 +5,12 @@
5
5
  */
6
6
 
7
7
  interface ImportMetaEnv {
8
- readonly DEV: boolean;
9
- readonly PROD: boolean;
10
- readonly VITE_ENABLE_COMPANION_MODE?: string;
11
- readonly VITE_ENABLE_MEMORY_MONITOR?: string;
8
+ readonly DEV: boolean;
9
+ readonly PROD: boolean;
10
+ readonly VITE_ENABLE_COMPANION_MODE?: string;
11
+ readonly VITE_ENABLE_MEMORY_MONITOR?: string;
12
12
  }
13
13
 
14
14
  interface ImportMeta {
15
- readonly env: ImportMetaEnv;
15
+ readonly env: ImportMetaEnv;
16
16
  }
package/src/api/client.ts CHANGED
@@ -21,8 +21,10 @@ import type {
21
21
  VisionConfig,
22
22
  VisionProvider,
23
23
  } from "@elizaos/autonomous/contracts/config";
24
- import type { DropStatus, MintResult } from "@elizaos/autonomous/contracts/drop";
25
- import type { VerificationResult } from "@elizaos/autonomous/contracts/verification";
24
+ import type {
25
+ DropStatus,
26
+ MintResult,
27
+ } from "@elizaos/autonomous/contracts/drop";
26
28
  import type {
27
29
  CloudProviderOption,
28
30
  ConnectorConfig,
@@ -41,6 +43,14 @@ import type {
41
43
  SubscriptionProviderStatus,
42
44
  SubscriptionStatusResponse,
43
45
  } from "@elizaos/autonomous/contracts/onboarding";
46
+ import type {
47
+ AllPermissionsState,
48
+ PermissionState,
49
+ PermissionStatus,
50
+ SystemPermissionDefinition,
51
+ SystemPermissionId,
52
+ } from "@elizaos/autonomous/contracts/permissions";
53
+ import type { VerificationResult } from "@elizaos/autonomous/contracts/verification";
44
54
  import type {
45
55
  BscTradeExecuteRequest,
46
56
  BscTradeExecuteResponse,
@@ -74,13 +84,6 @@ import {
74
84
  normalizeWalletRpcSelections,
75
85
  WALLET_RPC_PROVIDER_OPTIONS,
76
86
  } from "@elizaos/autonomous/contracts/wallet";
77
- import type {
78
- AllPermissionsState,
79
- PermissionState,
80
- PermissionStatus,
81
- SystemPermissionDefinition,
82
- SystemPermissionId,
83
- } from "@elizaos/autonomous/contracts/permissions";
84
87
  import type { ConfigUiHint } from "../types";
85
88
  import { stripAssistantStageDirections } from "../utils/assistant-text";
86
89
  import { mergeStreamingText } from "../utils/streaming-text";
@@ -123,8 +126,8 @@ export type {
123
126
  PermissionStatus,
124
127
  PiAiModelOption,
125
128
  ProviderOption,
126
- RpcProviderOption,
127
129
  ReleaseChannel,
130
+ RpcProviderOption,
128
131
  SolanaNft,
129
132
  SolanaTokenBalance,
130
133
  StylePreset,
@@ -2316,21 +2319,31 @@ export class MiladyClient {
2316
2319
  pairingEnabled: boolean;
2317
2320
  expiresAt: number | null;
2318
2321
  }> {
2319
- try {
2320
- return await this.fetch("/api/auth/status");
2321
- } catch (err: unknown) {
2322
- const status = (err as Error & { status?: number })?.status;
2323
- if (status === 401) {
2324
- // Server requires auth
2325
- return { required: true, pairingEnabled: false, expiresAt: null };
2326
- }
2327
- if (status === 404) {
2328
- // npm-installed server without auth routes — no auth required
2329
- return { required: false, pairingEnabled: false, expiresAt: null };
2322
+ // Retry with exponential backoff — the server may not be ready during boot.
2323
+ const maxRetries = 3;
2324
+ const baseBackoffMs = 1000;
2325
+ let lastErr: unknown;
2326
+ for (let attempt = 0; attempt <= maxRetries; attempt++) {
2327
+ try {
2328
+ return await this.fetch("/api/auth/status");
2329
+ } catch (err: unknown) {
2330
+ const status = (err as Error & { status?: number })?.status;
2331
+ if (status === 401) {
2332
+ return { required: true, pairingEnabled: false, expiresAt: null };
2333
+ }
2334
+ if (status === 404) {
2335
+ return { required: false, pairingEnabled: false, expiresAt: null };
2336
+ }
2337
+ lastErr = err;
2338
+ const kind = (err as Error & { kind?: string })?.kind;
2339
+ if (kind === "timeout" && attempt < maxRetries) {
2340
+ await new Promise((r) => setTimeout(r, baseBackoffMs * 2 ** attempt));
2341
+ continue;
2342
+ }
2343
+ if (attempt >= maxRetries) break;
2330
2344
  }
2331
- // Other errors (500, network) — re-throw so caller can handle
2332
- throw err;
2333
2345
  }
2346
+ throw lastErr;
2334
2347
  }
2335
2348
 
2336
2349
  async pair(code: string): Promise<{ token: string }> {
@@ -11,6 +11,7 @@
11
11
  import { Capacitor } from "@capacitor/core";
12
12
  import { isElectrobunRuntime } from "./electrobun-runtime";
13
13
  import {
14
+ type GenericNativePlugin,
14
15
  getCameraPlugin,
15
16
  getCanvasPlugin,
16
17
  getDesktopPlugin,
@@ -19,7 +20,6 @@ import {
19
20
  getScreenCapturePlugin,
20
21
  getSwabblePlugin,
21
22
  getTalkModePlugin,
22
- type GenericNativePlugin,
23
23
  type SwabblePluginLike,
24
24
  type TalkModePluginLike,
25
25
  } from "./native-plugins";
@@ -3,11 +3,14 @@ interface AvatarLoaderProps {
3
3
  label?: string;
4
4
  /** When true, renders as a full-screen loader instead of an overlay */
5
5
  fullScreen?: boolean;
6
+ /** When true, fades the loader out (use before unmounting) */
7
+ fadingOut?: boolean;
6
8
  }
7
9
 
8
10
  export function AvatarLoader({
9
11
  label = "Initializing entity",
10
12
  fullScreen = false,
13
+ fadingOut = false,
11
14
  }: AvatarLoaderProps) {
12
15
  return (
13
16
  <div
@@ -19,6 +22,9 @@ export function AvatarLoader({
19
22
  justifyContent: "center",
20
23
  background: fullScreen ? "#0c0e14" : "transparent",
21
24
  zIndex: 10,
25
+ opacity: fadingOut ? 0 : 1,
26
+ transition: "opacity 0.8s ease-out",
27
+ pointerEvents: fadingOut ? "none" : "auto",
22
28
  }}
23
29
  >
24
30
  <div
@@ -545,5 +545,5 @@ export function TradePanel({
545
545
  );
546
546
  }
547
547
 
548
- export { TradePanel as BscTradePanel };
549
548
  export type { TradePanelProps as BscTradePanelProps };
549
+ export { TradePanel as BscTradePanel };