@elizaos/app-core 2.0.0-alpha.84 → 2.0.0-alpha.85
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.
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
type AgentTab = "claude" | "gemini" | "codex" | "aider";
|
|
2
2
|
/** Map full adapter names from the preflight API to short tab keys. */
|
|
3
3
|
export declare const ADAPTER_NAME_TO_TAB: Record<string, AgentTab>;
|
|
4
|
+
/** Visible for testing — clears the module-level settings cache. */
|
|
5
|
+
export declare function _clearSettingsCache(): void;
|
|
4
6
|
export declare function CodingAgentSettingsSection(): import("react/jsx-runtime").JSX.Element;
|
|
5
7
|
export {};
|
|
6
8
|
//# sourceMappingURL=CodingAgentSettingsSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodingAgentSettingsSection.d.ts","sourceRoot":"","sources":["../../src/components/CodingAgentSettingsSection.tsx"],"names":[],"mappings":"AAQA,KAAK,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AA4ExD,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAQxD,CAAC;
|
|
1
|
+
{"version":3,"file":"CodingAgentSettingsSection.d.ts","sourceRoot":"","sources":["../../src/components/CodingAgentSettingsSection.tsx"],"names":[],"mappings":"AAQA,KAAK,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AA4ExD,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAQxD,CAAC;AAmBF,oEAAoE;AACpE,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED,wBAAgB,0BAA0B,4CAyczC"}
|
|
@@ -77,22 +77,31 @@ const ENV_PREFIX = {
|
|
|
77
77
|
codex: "PARALLAX_CODEX",
|
|
78
78
|
aider: "PARALLAX_AIDER",
|
|
79
79
|
};
|
|
80
|
+
let _settingsCache = null;
|
|
81
|
+
/** Visible for testing — clears the module-level settings cache. */
|
|
82
|
+
export function _clearSettingsCache() {
|
|
83
|
+
_settingsCache = null;
|
|
84
|
+
}
|
|
80
85
|
export function CodingAgentSettingsSection() {
|
|
81
86
|
const { setTimeout } = useTimeout();
|
|
82
87
|
const { t } = useApp();
|
|
83
88
|
const [activeTab, setActiveTab] = useState("claude");
|
|
84
|
-
const [loading, setLoading] = useState(
|
|
89
|
+
const [loading, setLoading] = useState(!_settingsCache);
|
|
85
90
|
const [dirty, setDirty] = useState(false);
|
|
86
91
|
const [saving, setSaving] = useState(false);
|
|
87
92
|
const [saveSuccess, setSaveSuccess] = useState(false);
|
|
88
93
|
const [saveError, setSaveError] = useState(null);
|
|
89
|
-
const [prefs, setPrefs] = useState({});
|
|
90
|
-
const [providerModels, setProviderModels] = useState({});
|
|
91
|
-
const [preflightLoaded, setPreflightLoaded] = useState(false);
|
|
92
|
-
const [preflightByAgent, setPreflightByAgent] = useState({});
|
|
94
|
+
const [prefs, setPrefs] = useState(_settingsCache?.prefs ?? {});
|
|
95
|
+
const [providerModels, setProviderModels] = useState(_settingsCache?.providerModels ?? {});
|
|
96
|
+
const [preflightLoaded, setPreflightLoaded] = useState(_settingsCache?.preflightLoaded ?? false);
|
|
97
|
+
const [preflightByAgent, setPreflightByAgent] = useState(_settingsCache?.preflightByAgent ?? {});
|
|
93
98
|
useEffect(() => {
|
|
94
99
|
void (async () => {
|
|
95
|
-
|
|
100
|
+
// Only show loading skeleton on very first fetch (no cache yet).
|
|
101
|
+
// When cache exists, we still fetch fresh data but don't block the UI.
|
|
102
|
+
if (!_settingsCache) {
|
|
103
|
+
setLoading(true);
|
|
104
|
+
}
|
|
96
105
|
try {
|
|
97
106
|
const [cfg, anthropicRes, googleRes, openaiRes, preflightRes] = await Promise.all([
|
|
98
107
|
client.getConfig(),
|
|
@@ -151,6 +160,8 @@ export function CodingAgentSettingsSection() {
|
|
|
151
160
|
}
|
|
152
161
|
}
|
|
153
162
|
setProviderModels(models);
|
|
163
|
+
let newPreflightByAgent = {};
|
|
164
|
+
let newPreflightLoaded = false;
|
|
154
165
|
if (Array.isArray(preflightRes)) {
|
|
155
166
|
const mapped = {};
|
|
156
167
|
for (const item of preflightRes) {
|
|
@@ -162,7 +173,16 @@ export function CodingAgentSettingsSection() {
|
|
|
162
173
|
}
|
|
163
174
|
setPreflightByAgent(mapped);
|
|
164
175
|
setPreflightLoaded(true);
|
|
176
|
+
newPreflightByAgent = mapped;
|
|
177
|
+
newPreflightLoaded = true;
|
|
165
178
|
}
|
|
179
|
+
// Persist to module-level cache so re-mounts are instant.
|
|
180
|
+
_settingsCache = {
|
|
181
|
+
prefs: loaded,
|
|
182
|
+
providerModels: models,
|
|
183
|
+
preflightByAgent: newPreflightByAgent,
|
|
184
|
+
preflightLoaded: newPreflightLoaded,
|
|
185
|
+
};
|
|
166
186
|
}
|
|
167
187
|
catch {
|
|
168
188
|
// Fall back to built-in defaults when config or model fetches fail.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/app-core",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.85",
|
|
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.
|
|
170
|
-
"@elizaos/ui": "^2.0.0-alpha.
|
|
169
|
+
"@elizaos/autonomous": "^2.0.0-alpha.85",
|
|
170
|
+
"@elizaos/ui": "^2.0.0-alpha.85",
|
|
171
171
|
"@sparkjsdev/spark": "^0.1.10",
|
|
172
172
|
"lucide-react": "^0.575.0",
|
|
173
173
|
"three": "^0.182.0",
|