@lark-apaas/openclaw-scripts-diagnose-cli 0.1.1-alpha.18 → 0.1.1-alpha.19
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/index.cjs +23 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1232,15 +1232,17 @@ function ensureOpenclawBinary(srcDir, log) {
|
|
|
1232
1232
|
return;
|
|
1233
1233
|
}
|
|
1234
1234
|
if (isOpenclawInstalled()) {
|
|
1235
|
-
const updateCmd = `openclaw update${targetVersion ? " --tag v" + targetVersion : ""}`;
|
|
1235
|
+
const updateCmd = `openclaw update${targetVersion ? " --tag v" + targetVersion : ""} --yes`;
|
|
1236
1236
|
log(`openclaw installed but version mismatched, running: ${updateCmd}`);
|
|
1237
|
+
const timeout = 12 * 6e4;
|
|
1237
1238
|
const t = Date.now();
|
|
1238
1239
|
try {
|
|
1239
|
-
shell(updateCmd,
|
|
1240
|
+
shell(updateCmd, timeout);
|
|
1240
1241
|
log(`openclaw update done in ${Date.now() - t}ms`);
|
|
1241
1242
|
} catch (e) {
|
|
1242
|
-
|
|
1243
|
-
|
|
1243
|
+
const elapsed = Date.now() - t;
|
|
1244
|
+
if (elapsed >= timeout - 1e3) log(`openclaw update timed out after ${elapsed}ms (non-fatal, continuing)`);
|
|
1245
|
+
else throw e;
|
|
1244
1246
|
}
|
|
1245
1247
|
} else {
|
|
1246
1248
|
log("openclaw binary not found, running full reinstall");
|
|
@@ -1290,15 +1292,26 @@ function mergeCoreBackupAndOrigins(configPath, vars, resetData, log) {
|
|
|
1290
1292
|
if (!config.agents) config.agents = {};
|
|
1291
1293
|
const agents = config.agents;
|
|
1292
1294
|
if (!Array.isArray(agents.list)) agents.list = [];
|
|
1293
|
-
|
|
1295
|
+
const configDir = node_path.default.dirname(configPath);
|
|
1296
|
+
for (const agent of backup.agents) {
|
|
1297
|
+
const enriched = {
|
|
1298
|
+
id: agent.id,
|
|
1299
|
+
name: agent.id,
|
|
1300
|
+
workspace: agent.workspace,
|
|
1301
|
+
agentDir: configDir + "/agents/" + agent.id + "/agent"
|
|
1302
|
+
};
|
|
1303
|
+
agents.list.push(enriched);
|
|
1304
|
+
}
|
|
1294
1305
|
merged.push(`agents(+${backup.agents.length})`);
|
|
1295
1306
|
const list = agents.list;
|
|
1296
|
-
|
|
1297
|
-
if (mainIdx
|
|
1298
|
-
list
|
|
1299
|
-
|
|
1300
|
-
merged.push("main-team-mode");
|
|
1307
|
+
let mainIdx = list.findIndex((a) => a.id === "main");
|
|
1308
|
+
if (mainIdx < 0) {
|
|
1309
|
+
list.unshift({ id: "main" });
|
|
1310
|
+
mainIdx = 0;
|
|
1301
1311
|
}
|
|
1312
|
+
list[mainIdx].subagents = { allowAgents: ["*"] };
|
|
1313
|
+
list[mainIdx].default = true;
|
|
1314
|
+
merged.push("main-team-mode");
|
|
1302
1315
|
const feishu = config.channels?.feishu;
|
|
1303
1316
|
if (feishu) {
|
|
1304
1317
|
if (!feishu.accounts) feishu.accounts = {};
|
package/package.json
CHANGED