@openclawcity/become 1.0.8 → 1.0.11
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/cli.cjs +39 -9
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +39 -9
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -115,10 +115,13 @@ function patchOpenClaw(config, agentId) {
|
|
|
115
115
|
]
|
|
116
116
|
};
|
|
117
117
|
writeFileSync2(OPENCLAW_CONFIG, JSON.stringify(clawConfig, null, 2), "utf-8");
|
|
118
|
+
console.log("Restarting OpenClaw gateway...");
|
|
118
119
|
try {
|
|
119
120
|
execSync("openclaw gateway restart", { stdio: "pipe", timeout: 15e3 });
|
|
121
|
+
console.log("OpenClaw gateway restarted. Your agent is now routing through become.");
|
|
120
122
|
} catch {
|
|
121
|
-
console.log("
|
|
123
|
+
console.log("\n*** OpenClaw gateway needs a manual restart to pick up the new config. ***");
|
|
124
|
+
console.log("*** Run: openclaw gateway restart ***\n");
|
|
122
125
|
}
|
|
123
126
|
}
|
|
124
127
|
function restoreOpenClaw() {
|
|
@@ -197,10 +200,13 @@ function readStateFile(path) {
|
|
|
197
200
|
}
|
|
198
201
|
}
|
|
199
202
|
function restartGateway() {
|
|
203
|
+
console.log("Restarting OpenClaw gateway...");
|
|
200
204
|
try {
|
|
201
205
|
execSync("openclaw gateway restart", { stdio: "pipe", timeout: 15e3 });
|
|
206
|
+
console.log("OpenClaw gateway restarted.");
|
|
202
207
|
} catch {
|
|
203
|
-
console.log("
|
|
208
|
+
console.log("\n*** OpenClaw gateway needs a manual restart. ***");
|
|
209
|
+
console.log("*** Run: openclaw gateway restart ***\n");
|
|
204
210
|
}
|
|
205
211
|
}
|
|
206
212
|
|
|
@@ -272,8 +278,7 @@ Proxy port (default 30001): `);
|
|
|
272
278
|
};
|
|
273
279
|
saveConfig(config);
|
|
274
280
|
console.log("\nConfig saved to ~/.become/config.json");
|
|
275
|
-
console.log("Run `become start` to
|
|
276
|
-
console.log("Run `become on` to route your agent through become.\n");
|
|
281
|
+
console.log("Run `become start` to begin. Ctrl+C to stop.\n");
|
|
277
282
|
} finally {
|
|
278
283
|
rl.close();
|
|
279
284
|
}
|
|
@@ -1398,10 +1403,13 @@ function patchIronClaw(config) {
|
|
|
1398
1403
|
patchDotEnv(IRONCLAW_ENV, {
|
|
1399
1404
|
LLM_BASE_URL: `http://127.0.0.1:${config.proxy_port}/v1`
|
|
1400
1405
|
});
|
|
1406
|
+
console.log("Restarting IronClaw...");
|
|
1401
1407
|
try {
|
|
1402
1408
|
execSync2("ironclaw service restart", { stdio: "pipe", timeout: 15e3 });
|
|
1409
|
+
console.log("IronClaw restarted.");
|
|
1403
1410
|
} catch {
|
|
1404
|
-
console.log("
|
|
1411
|
+
console.log("\n*** IronClaw needs a manual restart. ***");
|
|
1412
|
+
console.log("*** Run: ironclaw service restart ***\n");
|
|
1405
1413
|
}
|
|
1406
1414
|
}
|
|
1407
1415
|
function restoreIronClaw() {
|
|
@@ -1409,10 +1417,13 @@ function restoreIronClaw() {
|
|
|
1409
1417
|
throw new Error("No backup found. Was become ever turned on?");
|
|
1410
1418
|
}
|
|
1411
1419
|
copyFileSync(BACKUP_PATH2, IRONCLAW_ENV);
|
|
1420
|
+
console.log("Restarting IronClaw...");
|
|
1412
1421
|
try {
|
|
1413
1422
|
execSync2("ironclaw service restart", { stdio: "pipe", timeout: 15e3 });
|
|
1423
|
+
console.log("IronClaw restarted.");
|
|
1414
1424
|
} catch {
|
|
1415
|
-
console.log("
|
|
1425
|
+
console.log("\n*** IronClaw needs a manual restart. ***");
|
|
1426
|
+
console.log("*** Run: ironclaw service restart ***\n");
|
|
1416
1427
|
}
|
|
1417
1428
|
}
|
|
1418
1429
|
function patchDotEnv(path, vars) {
|
|
@@ -1475,13 +1486,18 @@ function findNanoClawEnv() {
|
|
|
1475
1486
|
return null;
|
|
1476
1487
|
}
|
|
1477
1488
|
function restartNanoClaw() {
|
|
1489
|
+
console.log("Restarting NanoClaw...");
|
|
1478
1490
|
try {
|
|
1479
1491
|
execSync3("launchctl kickstart -k gui/$(id -u)/ai.nanoclaw.agent", { stdio: "pipe", timeout: 15e3 });
|
|
1492
|
+
console.log("NanoClaw restarted.");
|
|
1480
1493
|
} catch {
|
|
1481
1494
|
try {
|
|
1482
1495
|
execSync3("systemctl --user restart nanoclaw", { stdio: "pipe", timeout: 15e3 });
|
|
1496
|
+
console.log("NanoClaw restarted.");
|
|
1483
1497
|
} catch {
|
|
1484
|
-
console.log("
|
|
1498
|
+
console.log("\n*** NanoClaw needs a manual restart. ***");
|
|
1499
|
+
console.log("*** macOS: launchctl kickstart -k gui/$(id -u)/ai.nanoclaw.agent ***");
|
|
1500
|
+
console.log("*** Linux: systemctl --user restart nanoclaw ***\n");
|
|
1485
1501
|
}
|
|
1486
1502
|
}
|
|
1487
1503
|
}
|
|
@@ -1549,12 +1565,26 @@ async function start() {
|
|
|
1549
1565
|
become proxy running on localhost:${config.proxy_port}`);
|
|
1550
1566
|
console.log(`become dashboard at http://localhost:${config.dashboard_port}`);
|
|
1551
1567
|
console.log(`
|
|
1552
|
-
|
|
1568
|
+
Connected to: ${config.agent_type}${config.openclaw_agent_id ? ` (agent: ${config.openclaw_agent_id})` : ""}`);
|
|
1569
|
+
console.log(`Skills loaded: ${approved} approved, ${pending} pending`);
|
|
1553
1570
|
console.log(`Trust rules: ${trustConfig.trusted.length} trusted, ${trustConfig.blocked.length} blocked`);
|
|
1554
1571
|
console.log("\nYour agent is learning from other agents.");
|
|
1555
1572
|
console.log("Dashboard: http://localhost:" + config.dashboard_port);
|
|
1556
|
-
console.log("Ctrl+C to stop
|
|
1573
|
+
console.log("Ctrl+C to stop.");
|
|
1574
|
+
setTimeout(() => {
|
|
1575
|
+
if (proxy.stats.requests_forwarded === 0) {
|
|
1576
|
+
console.log("\nWaiting for first request from your agent...");
|
|
1577
|
+
console.log("(If nothing happens, make sure your agent is running and talking to other agents)");
|
|
1578
|
+
}
|
|
1579
|
+
}, 1e4);
|
|
1580
|
+
const activityInterval = setInterval(() => {
|
|
1581
|
+
const s = proxy.stats;
|
|
1582
|
+
if (s.requests_forwarded > 0) {
|
|
1583
|
+
console.log(`[become] ${s.requests_forwarded} requests forwarded, ${s.skills_injected} skills injected, ${s.lessons_extracted} lessons extracted`);
|
|
1584
|
+
}
|
|
1585
|
+
}, 6e4);
|
|
1557
1586
|
const shutdown = async () => {
|
|
1587
|
+
clearInterval(activityInterval);
|
|
1558
1588
|
console.log("\nShutting down...");
|
|
1559
1589
|
try {
|
|
1560
1590
|
turnOff();
|