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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/app-core",
3
- "version": "2.0.0-alpha.75",
3
+ "version": "2.0.0-alpha.77",
4
4
  "description": "Shared application core for Milady shells and white-label apps.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -166,8 +166,8 @@
166
166
  "@capacitor/haptics": "8.0.0",
167
167
  "@capacitor/keyboard": "8.0.0",
168
168
  "@capacitor/preferences": "^8.0.1",
169
- "@elizaos/autonomous": "^2.0.0-alpha.75",
170
- "@elizaos/ui": "^2.0.0-alpha.75",
169
+ "@elizaos/autonomous": "^2.0.0-alpha.77",
170
+ "@elizaos/ui": "^2.0.0-alpha.77",
171
171
  "@sparkjsdev/spark": "^0.1.10",
172
172
  "lucide-react": "^0.575.0",
173
173
  "three": "^0.182.0",
@@ -1 +1 @@
1
- {"version":3,"file":"AppContext.d.ts","sourceRoot":"","sources":["../../src/state/AppContext.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EACL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AA0Kf,OAAO,EACL,KAAK,YAAY,EACjB,sBAAsB,EACtB,YAAY,EACZ,kCAAkC,EAClC,KAAK,UAAU,EACf,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,YAAY,EACZ,cAAc,EACd,KAAK,aAAa,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,EACxB,KAAK,0BAA0B,EAC/B,yBAAyB,EACzB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,8BAA8B,EACnC,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,6BAA6B,EAC7B,oBAAoB,EACpB,gBAAgB,EAChB,4BAA4B,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,4BAA4B,EAC5B,qBAAqB,EACrB,6BAA6B,EAC7B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,6BAA6B,EAC7B,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,WAAW,EACX,0BAA0B,EAC1B,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,MAAM,EACN,SAAS,GACV,MAAM,YAAY,CAAC;AAiLpB,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,QAAQ,EAAE,gBAAgB,GAC3B,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC,OAAO,oBAAoB,EAAE,cAAc,CAAC,CAAC;CACjE,2CAm3LA"}
1
+ {"version":3,"file":"AppContext.d.ts","sourceRoot":"","sources":["../../src/state/AppContext.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EACL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AA0Kf,OAAO,EACL,KAAK,YAAY,EACjB,sBAAsB,EACtB,YAAY,EACZ,kCAAkC,EAClC,KAAK,UAAU,EACf,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,YAAY,EACZ,cAAc,EACd,KAAK,aAAa,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,EACxB,KAAK,0BAA0B,EAC/B,yBAAyB,EACzB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,8BAA8B,EACnC,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,6BAA6B,EAC7B,oBAAoB,EACpB,gBAAgB,EAChB,4BAA4B,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,4BAA4B,EAC5B,qBAAqB,EACrB,6BAA6B,EAC7B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,6BAA6B,EAC7B,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,WAAW,EACX,0BAA0B,EAC1B,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,MAAM,EACN,SAAS,GACV,MAAM,YAAY,CAAC;AAiLpB,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,QAAQ,EAAE,gBAAgB,GAC3B,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC,OAAO,oBAAoB,EAAE,cAAc,CAAC,CAAC;CACjE,2CA60LA"}
@@ -3959,35 +3959,7 @@ export function AppProvider({ children, branding: brandingOverride, }) {
3959
3959
  setStartupPhase("starting-backend");
3960
3960
  setAuthRequired(false);
3961
3961
  setConnected(false);
3962
- // If onboarding hasn't been completed yet (no persisted connection),
3963
- // skip all backend polling and go straight to onboarding with static
3964
- // data. The agent will be started (local mode) or provisioned (sandbox
3965
- // mode) only after onboarding completes. This ensures the entire
3966
- // onboarding flow — character selection, editing, provider config —
3967
- // works with zero server calls.
3968
3962
  const persistedConnection = loadPersistedConnectionMode();
3969
- if (!persistedConnection) {
3970
- // Onboarding not completed — show it immediately without waiting
3971
- // for a backend. Populate onboardingOptions with static frontend
3972
- // data so handleOnboardingFinish doesn't early-return on null options.
3973
- const injectedStyles = (typeof window !== "undefined" &&
3974
- window
3975
- .__APP_ONBOARDING_STYLES__) ||
3976
- [];
3977
- setOnboardingOptions({
3978
- names: [],
3979
- styles: injectedStyles,
3980
- providers: [...ONBOARDING_PROVIDER_CATALOG],
3981
- cloudProviders: [],
3982
- models: { small: [], large: [] },
3983
- inventoryProviders: [],
3984
- sharedStyleRules: "",
3985
- });
3986
- setStartupPhase("ready");
3987
- setOnboardingComplete(false);
3988
- setOnboardingLoading(false);
3989
- return;
3990
- }
3991
3963
  // Restore connection from persisted state for returning users
3992
3964
  if (persistedConnection) {
3993
3965
  if (persistedConnection.runMode === "cloud" &&
@@ -4065,6 +4037,12 @@ export function AppProvider({ children, branding: brandingOverride, }) {
4065
4037
  setOnboardingLoading(false);
4066
4038
  return;
4067
4039
  }
4040
+ if (!persistedConnection && backendAttempts > 0) {
4041
+ // Unreachable and no persisted connection — fallback to static onboarding immediately
4042
+ onboardingNeedsOptions = true;
4043
+ setOnboardingComplete(false);
4044
+ break;
4045
+ }
4068
4046
  lastBackendError = err;
4069
4047
  backendAttempts += 1;
4070
4048
  const delay = Math.min(BASE_DELAY_MS * 2 ** Math.min(backendAttempts, 2), MAX_DELAY_MS);
@@ -4081,109 +4059,91 @@ export function AppProvider({ children, branding: brandingOverride, }) {
4081
4059
  }
4082
4060
  // On fresh installs, unblock to onboarding as soon as options are available.
4083
4061
  if (onboardingNeedsOptions) {
4084
- const optionsStartedAt = Date.now();
4085
- let optionsError = null;
4086
- while (!cancelled) {
4087
- if (Date.now() - optionsStartedAt >= getBackendStartupTimeoutMs()) {
4088
- setStartupError(describeBackendFailure(optionsError, true));
4089
- setOnboardingLoading(false);
4090
- return;
4091
- }
4062
+ let config = null;
4063
+ if (connected || backendAttempts > 0) {
4064
+ // Only fetch config if we reached a backend or attempted to
4065
+ config = await client.getConfig().catch(() => null);
4066
+ }
4067
+ if (onboardingCompletionCommittedRef.current) {
4068
+ setStartupPhase("ready");
4069
+ setOnboardingLoading(false);
4070
+ return;
4071
+ }
4072
+ const resumeConnection = deriveOnboardingResumeConnection(config);
4073
+ const resumeFields = deriveOnboardingResumeFields(resumeConnection);
4074
+ onboardingResumeConnectionRef.current = resumeConnection;
4075
+ const injectedStyles = (typeof window !== "undefined" &&
4076
+ window
4077
+ .__APP_ONBOARDING_STYLES__) ||
4078
+ [];
4079
+ setOnboardingOptions({
4080
+ names: [],
4081
+ styles: injectedStyles,
4082
+ providers: [...ONBOARDING_PROVIDER_CATALOG],
4083
+ cloudProviders: [],
4084
+ models: { small: [], large: [] },
4085
+ inventoryProviders: [],
4086
+ sharedStyleRules: "",
4087
+ });
4088
+ // Auto-detect AI provider credentials from local CLI installs.
4089
+ // Only auto-fill if no existing connection config was found.
4090
+ if (!resumeConnection) {
4092
4091
  try {
4093
- const [options, config] = await Promise.all([
4094
- client.getOnboardingOptions(),
4095
- client.getConfig().catch(() => null),
4096
- ]);
4097
- if (onboardingCompletionCommittedRef.current) {
4098
- setStartupPhase("ready");
4099
- setOnboardingLoading(false);
4100
- return;
4101
- }
4102
- const resumeConnection = deriveOnboardingResumeConnection(config);
4103
- const resumeFields = deriveOnboardingResumeFields(resumeConnection);
4104
- onboardingResumeConnectionRef.current = resumeConnection;
4105
- setOnboardingOptions(options);
4106
- // Auto-detect AI provider credentials from local CLI installs.
4107
- // Only auto-fill if no existing connection config was found.
4108
- if (!resumeConnection) {
4109
- try {
4110
- const detected = await scanProviderCredentials();
4111
- if (detected.length > 0) {
4112
- setOnboardingDetectedProviders(detected);
4113
- // Auto-fill with the first detected provider
4114
- const first = detected[0];
4115
- if (first.apiKey) {
4116
- setOnboardingRunMode("local");
4117
- setOnboardingProvider(first.id);
4118
- setOnboardingApiKey(first.apiKey);
4119
- }
4120
- }
4092
+ const detected = await scanProviderCredentials();
4093
+ if (detected.length > 0) {
4094
+ setOnboardingDetectedProviders(detected);
4095
+ // Auto-fill with the first detected provider
4096
+ const first = detected[0];
4097
+ if (first.apiKey) {
4098
+ setOnboardingRunMode("local");
4099
+ setOnboardingProvider(first.id);
4100
+ setOnboardingApiKey(first.apiKey);
4121
4101
  }
4122
- catch {
4123
- // Non-fatal — credential scan is best-effort
4124
- }
4125
- }
4126
- if (resumeFields.onboardingRunMode !== undefined) {
4127
- setOnboardingRunMode(resumeFields.onboardingRunMode);
4128
- }
4129
- if (resumeFields.onboardingCloudProvider !== undefined) {
4130
- setOnboardingCloudProvider(resumeFields.onboardingCloudProvider);
4131
- }
4132
- if (resumeFields.onboardingProvider !== undefined) {
4133
- setOnboardingProvider(resumeFields.onboardingProvider);
4134
4102
  }
4135
- if (resumeFields.onboardingApiKey !== undefined) {
4136
- setOnboardingApiKey(resumeFields.onboardingApiKey);
4137
- }
4138
- if (resumeFields.onboardingPrimaryModel !== undefined) {
4139
- setOnboardingPrimaryModel(resumeFields.onboardingPrimaryModel);
4140
- }
4141
- if (resumeFields.onboardingOpenRouterModel !== undefined) {
4142
- setOnboardingOpenRouterModel(resumeFields.onboardingOpenRouterModel);
4143
- }
4144
- if (resumeFields.onboardingRemoteConnected !== undefined) {
4145
- setOnboardingRemoteConnected(resumeFields.onboardingRemoteConnected);
4146
- }
4147
- if (resumeFields.onboardingRemoteApiBase !== undefined) {
4148
- setOnboardingRemoteApiBase(resumeFields.onboardingRemoteApiBase);
4149
- }
4150
- if (resumeFields.onboardingRemoteToken !== undefined) {
4151
- setOnboardingRemoteToken(resumeFields.onboardingRemoteToken);
4152
- }
4153
- if (resumeFields.onboardingSmallModel !== undefined) {
4154
- setOnboardingSmallModel(resumeFields.onboardingSmallModel);
4155
- }
4156
- if (resumeFields.onboardingLargeModel !== undefined) {
4157
- setOnboardingLargeModel(resumeFields.onboardingLargeModel);
4158
- }
4159
- setOnboardingStep(inferOnboardingResumeStep({
4160
- persistedStep: loadPersistedOnboardingStep(),
4161
- config,
4162
- }));
4163
- setStartupPhase("ready");
4164
- setOnboardingLoading(false);
4165
- return;
4166
4103
  }
4167
- catch (err) {
4168
- const apiErr = asApiLikeError(err);
4169
- if (apiErr?.status === 401 && client.hasToken()) {
4170
- client.setToken(null);
4171
- setAuthRequired(true);
4172
- setPairingEnabled(latestAuth.pairingEnabled);
4173
- setPairingExpiresAt(latestAuth.expiresAt);
4174
- setStartupPhase("ready");
4175
- setOnboardingLoading(false);
4176
- return;
4177
- }
4178
- if (apiErr?.status === 404) {
4179
- setStartupError(describeBackendFailure(err, false));
4180
- setOnboardingLoading(false);
4181
- return;
4182
- }
4183
- optionsError = err;
4184
- await sleep(500);
4104
+ catch {
4105
+ // Non-fatal credential scan is best-effort
4185
4106
  }
4186
4107
  }
4108
+ if (resumeFields.onboardingRunMode !== undefined) {
4109
+ setOnboardingRunMode(resumeFields.onboardingRunMode);
4110
+ }
4111
+ if (resumeFields.onboardingCloudProvider !== undefined) {
4112
+ setOnboardingCloudProvider(resumeFields.onboardingCloudProvider);
4113
+ }
4114
+ if (resumeFields.onboardingProvider !== undefined) {
4115
+ setOnboardingProvider(resumeFields.onboardingProvider);
4116
+ }
4117
+ if (resumeFields.onboardingApiKey !== undefined) {
4118
+ setOnboardingApiKey(resumeFields.onboardingApiKey);
4119
+ }
4120
+ if (resumeFields.onboardingPrimaryModel !== undefined) {
4121
+ setOnboardingPrimaryModel(resumeFields.onboardingPrimaryModel);
4122
+ }
4123
+ if (resumeFields.onboardingOpenRouterModel !== undefined) {
4124
+ setOnboardingOpenRouterModel(resumeFields.onboardingOpenRouterModel);
4125
+ }
4126
+ if (resumeFields.onboardingRemoteConnected !== undefined) {
4127
+ setOnboardingRemoteConnected(resumeFields.onboardingRemoteConnected);
4128
+ }
4129
+ if (resumeFields.onboardingRemoteApiBase !== undefined) {
4130
+ setOnboardingRemoteApiBase(resumeFields.onboardingRemoteApiBase);
4131
+ }
4132
+ if (resumeFields.onboardingRemoteToken !== undefined) {
4133
+ setOnboardingRemoteToken(resumeFields.onboardingRemoteToken);
4134
+ }
4135
+ if (resumeFields.onboardingSmallModel !== undefined) {
4136
+ setOnboardingSmallModel(resumeFields.onboardingSmallModel);
4137
+ }
4138
+ if (resumeFields.onboardingLargeModel !== undefined) {
4139
+ setOnboardingLargeModel(resumeFields.onboardingLargeModel);
4140
+ }
4141
+ setOnboardingStep(inferOnboardingResumeStep({
4142
+ persistedStep: loadPersistedOnboardingStep(),
4143
+ config,
4144
+ }));
4145
+ setStartupPhase("ready");
4146
+ setOnboardingLoading(false);
4187
4147
  return;
4188
4148
  }
4189
4149
  setStartupPhase("initializing-agent");
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Shaw Walters and elizaOS Contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.