@openclawcity/become 1.0.9 → 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 +38 -7
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +38 -7
- 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
|
|
|
@@ -1397,10 +1403,13 @@ function patchIronClaw(config) {
|
|
|
1397
1403
|
patchDotEnv(IRONCLAW_ENV, {
|
|
1398
1404
|
LLM_BASE_URL: `http://127.0.0.1:${config.proxy_port}/v1`
|
|
1399
1405
|
});
|
|
1406
|
+
console.log("Restarting IronClaw...");
|
|
1400
1407
|
try {
|
|
1401
1408
|
execSync2("ironclaw service restart", { stdio: "pipe", timeout: 15e3 });
|
|
1409
|
+
console.log("IronClaw restarted.");
|
|
1402
1410
|
} catch {
|
|
1403
|
-
console.log("
|
|
1411
|
+
console.log("\n*** IronClaw needs a manual restart. ***");
|
|
1412
|
+
console.log("*** Run: ironclaw service restart ***\n");
|
|
1404
1413
|
}
|
|
1405
1414
|
}
|
|
1406
1415
|
function restoreIronClaw() {
|
|
@@ -1408,10 +1417,13 @@ function restoreIronClaw() {
|
|
|
1408
1417
|
throw new Error("No backup found. Was become ever turned on?");
|
|
1409
1418
|
}
|
|
1410
1419
|
copyFileSync(BACKUP_PATH2, IRONCLAW_ENV);
|
|
1420
|
+
console.log("Restarting IronClaw...");
|
|
1411
1421
|
try {
|
|
1412
1422
|
execSync2("ironclaw service restart", { stdio: "pipe", timeout: 15e3 });
|
|
1423
|
+
console.log("IronClaw restarted.");
|
|
1413
1424
|
} catch {
|
|
1414
|
-
console.log("
|
|
1425
|
+
console.log("\n*** IronClaw needs a manual restart. ***");
|
|
1426
|
+
console.log("*** Run: ironclaw service restart ***\n");
|
|
1415
1427
|
}
|
|
1416
1428
|
}
|
|
1417
1429
|
function patchDotEnv(path, vars) {
|
|
@@ -1474,13 +1486,18 @@ function findNanoClawEnv() {
|
|
|
1474
1486
|
return null;
|
|
1475
1487
|
}
|
|
1476
1488
|
function restartNanoClaw() {
|
|
1489
|
+
console.log("Restarting NanoClaw...");
|
|
1477
1490
|
try {
|
|
1478
1491
|
execSync3("launchctl kickstart -k gui/$(id -u)/ai.nanoclaw.agent", { stdio: "pipe", timeout: 15e3 });
|
|
1492
|
+
console.log("NanoClaw restarted.");
|
|
1479
1493
|
} catch {
|
|
1480
1494
|
try {
|
|
1481
1495
|
execSync3("systemctl --user restart nanoclaw", { stdio: "pipe", timeout: 15e3 });
|
|
1496
|
+
console.log("NanoClaw restarted.");
|
|
1482
1497
|
} catch {
|
|
1483
|
-
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");
|
|
1484
1501
|
}
|
|
1485
1502
|
}
|
|
1486
1503
|
}
|
|
@@ -1548,12 +1565,26 @@ async function start() {
|
|
|
1548
1565
|
become proxy running on localhost:${config.proxy_port}`);
|
|
1549
1566
|
console.log(`become dashboard at http://localhost:${config.dashboard_port}`);
|
|
1550
1567
|
console.log(`
|
|
1551
|
-
|
|
1568
|
+
Connected to: ${config.agent_type}${config.openclaw_agent_id ? ` (agent: ${config.openclaw_agent_id})` : ""}`);
|
|
1569
|
+
console.log(`Skills loaded: ${approved} approved, ${pending} pending`);
|
|
1552
1570
|
console.log(`Trust rules: ${trustConfig.trusted.length} trusted, ${trustConfig.blocked.length} blocked`);
|
|
1553
1571
|
console.log("\nYour agent is learning from other agents.");
|
|
1554
1572
|
console.log("Dashboard: http://localhost:" + config.dashboard_port);
|
|
1555
|
-
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);
|
|
1556
1586
|
const shutdown = async () => {
|
|
1587
|
+
clearInterval(activityInterval);
|
|
1557
1588
|
console.log("\nShutting down...");
|
|
1558
1589
|
try {
|
|
1559
1590
|
turnOff();
|