create-openclaw-bot 5.8.19 → 5.8.20
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/dist/server/local-server.js +5 -2
- package/dist/web/app.js +24 -4
- package/package.json +1 -1
|
@@ -3322,8 +3322,10 @@ async function handler(req, res, rootProjectDir) {
|
|
|
3322
3322
|
return json(res, result);
|
|
3323
3323
|
}
|
|
3324
3324
|
if (url.pathname === '/api/bot/files' && req.method === 'GET') {
|
|
3325
|
-
await resolveProjectDir(rootProjectDir, Object.fromEntries(url.searchParams));
|
|
3326
|
-
return json(res, { files:
|
|
3325
|
+
const projectDir = await resolveProjectDir(rootProjectDir, Object.fromEntries(url.searchParams));
|
|
3326
|
+
if (!projectDir) return json(res, { files: [] });
|
|
3327
|
+
const agentId = url.searchParams.get('agentId') || '';
|
|
3328
|
+
return json(res, { files: await listMarkdownFiles(projectDir, agentId).catch(() => []) });
|
|
3327
3329
|
}
|
|
3328
3330
|
if (url.pathname.startsWith('/api/bot/files/')) {
|
|
3329
3331
|
const name = decodeURIComponent(url.pathname.replace('/api/bot/files/', ''));
|
|
@@ -3357,6 +3359,7 @@ async function handler(req, res, rootProjectDir) {
|
|
|
3357
3359
|
});
|
|
3358
3360
|
if (url.pathname === '/api/features' && req.method === 'GET') {
|
|
3359
3361
|
const projectDir = await resolveProjectDir(rootProjectDir, Object.fromEntries(url.searchParams));
|
|
3362
|
+
if (!projectDir) return json(res, { flags: {}, installed: {}, versions: {} });
|
|
3360
3363
|
return json(res, await getFeatureFlags(projectDir, url.searchParams.get('agentId') || ''));
|
|
3361
3364
|
}
|
|
3362
3365
|
if (url.pathname === '/api/features/toggle' && req.method === 'POST') {
|
package/dist/web/app.js
CHANGED
|
@@ -1279,11 +1279,29 @@ function currentBotId() {
|
|
|
1279
1279
|
async function loadFiles(silent=false){
|
|
1280
1280
|
const botId = currentBotId();
|
|
1281
1281
|
if (!botId) { state.files = []; if (!silent) render(); return; }
|
|
1282
|
-
|
|
1282
|
+
try {
|
|
1283
|
+
state.files = (await api('/api/bot/files' + projectQuery({ agentId: botId }))).files;
|
|
1284
|
+
} catch (_) {
|
|
1285
|
+
state.files = [];
|
|
1286
|
+
}
|
|
1283
1287
|
if (!silent) render();
|
|
1284
1288
|
}
|
|
1285
1289
|
async function loadCatalog(silent=false){ state.catalog = await api('/api/catalog'); if (!silent) render(); }
|
|
1286
|
-
async function loadFeatureFlags(silent=false){
|
|
1290
|
+
async function loadFeatureFlags(silent=false){
|
|
1291
|
+
const botId=currentBotId();
|
|
1292
|
+
if (!activeProjectDir()) { state.featureFlags = {}; state.featureInstalled = {}; state.featureVersions = {}; if (!silent) render(); return; }
|
|
1293
|
+
try {
|
|
1294
|
+
const data = (await api('/api/features' + projectQuery({ agentId: botId }))) || {};
|
|
1295
|
+
state.featureFlags = data.flags || {};
|
|
1296
|
+
state.featureInstalled = data.installed || {};
|
|
1297
|
+
state.featureVersions = data.versions || {};
|
|
1298
|
+
} catch (_) {
|
|
1299
|
+
state.featureFlags = {};
|
|
1300
|
+
state.featureInstalled = {};
|
|
1301
|
+
state.featureVersions = {};
|
|
1302
|
+
}
|
|
1303
|
+
if (!silent) render();
|
|
1304
|
+
}
|
|
1287
1305
|
function appendLogLine(line) {
|
|
1288
1306
|
if (line.includes('Setup Wizard updated successfully! Please restart the installer.')) {
|
|
1289
1307
|
showToast(t('Đang khởi động lại UI', 'Restarting Setup UI'), t('Hệ thống đang tự khởi động lại để áp dụng phiên bản mới...', 'The system is restarting to apply the new version...'), 'info', 12000);
|
|
@@ -1386,8 +1404,10 @@ function showToast(title, desc, type = 'info', duration = 4000) {
|
|
|
1386
1404
|
}
|
|
1387
1405
|
}
|
|
1388
1406
|
|
|
1389
|
-
render();
|
|
1390
|
-
Promise.
|
|
1407
|
+
render();
|
|
1408
|
+
Promise.allSettled([loadSystem(true), loadStatus(true), loadCatalog(true)])
|
|
1409
|
+
.then(() => loadFeatureFlags(true).catch(() => {}))
|
|
1410
|
+
.finally(() => { render(); connectLogs(); });
|
|
1391
1411
|
|
|
1392
1412
|
|
|
1393
1413
|
|