@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 CHANGED
@@ -154,10 +154,13 @@ function patchOpenClaw(config, agentId) {
154
154
  ]
155
155
  };
156
156
  (0, import_node_fs2.writeFileSync)(OPENCLAW_CONFIG, JSON.stringify(clawConfig, null, 2), "utf-8");
157
+ console.log("Restarting OpenClaw gateway...");
157
158
  try {
158
159
  (0, import_node_child_process.execSync)("openclaw gateway restart", { stdio: "pipe", timeout: 15e3 });
160
+ console.log("OpenClaw gateway restarted. Your agent is now routing through become.");
159
161
  } catch {
160
- console.log("Warning: Could not restart OpenClaw gateway. Restart it manually: openclaw gateway restart");
162
+ console.log("\n*** OpenClaw gateway needs a manual restart to pick up the new config. ***");
163
+ console.log("*** Run: openclaw gateway restart ***\n");
161
164
  }
162
165
  }
163
166
  function restoreOpenClaw() {
@@ -236,10 +239,13 @@ function readStateFile(path) {
236
239
  }
237
240
  }
238
241
  function restartGateway() {
242
+ console.log("Restarting OpenClaw gateway...");
239
243
  try {
240
244
  (0, import_node_child_process.execSync)("openclaw gateway restart", { stdio: "pipe", timeout: 15e3 });
245
+ console.log("OpenClaw gateway restarted.");
241
246
  } catch {
242
- console.log("Warning: Could not restart OpenClaw gateway. Restart it manually: openclaw gateway restart");
247
+ console.log("\n*** OpenClaw gateway needs a manual restart. ***");
248
+ console.log("*** Run: openclaw gateway restart ***\n");
243
249
  }
244
250
  }
245
251
 
@@ -1436,10 +1442,13 @@ function patchIronClaw(config) {
1436
1442
  patchDotEnv(IRONCLAW_ENV, {
1437
1443
  LLM_BASE_URL: `http://127.0.0.1:${config.proxy_port}/v1`
1438
1444
  });
1445
+ console.log("Restarting IronClaw...");
1439
1446
  try {
1440
1447
  (0, import_node_child_process2.execSync)("ironclaw service restart", { stdio: "pipe", timeout: 15e3 });
1448
+ console.log("IronClaw restarted.");
1441
1449
  } catch {
1442
- console.log("Warning: Could not restart IronClaw. Restart it manually: ironclaw service restart");
1450
+ console.log("\n*** IronClaw needs a manual restart. ***");
1451
+ console.log("*** Run: ironclaw service restart ***\n");
1443
1452
  }
1444
1453
  }
1445
1454
  function restoreIronClaw() {
@@ -1447,10 +1456,13 @@ function restoreIronClaw() {
1447
1456
  throw new Error("No backup found. Was become ever turned on?");
1448
1457
  }
1449
1458
  (0, import_node_fs5.copyFileSync)(BACKUP_PATH2, IRONCLAW_ENV);
1459
+ console.log("Restarting IronClaw...");
1450
1460
  try {
1451
1461
  (0, import_node_child_process2.execSync)("ironclaw service restart", { stdio: "pipe", timeout: 15e3 });
1462
+ console.log("IronClaw restarted.");
1452
1463
  } catch {
1453
- console.log("Warning: Could not restart IronClaw. Restart it manually: ironclaw service restart");
1464
+ console.log("\n*** IronClaw needs a manual restart. ***");
1465
+ console.log("*** Run: ironclaw service restart ***\n");
1454
1466
  }
1455
1467
  }
1456
1468
  function patchDotEnv(path, vars) {
@@ -1513,13 +1525,18 @@ function findNanoClawEnv() {
1513
1525
  return null;
1514
1526
  }
1515
1527
  function restartNanoClaw() {
1528
+ console.log("Restarting NanoClaw...");
1516
1529
  try {
1517
1530
  (0, import_node_child_process3.execSync)("launchctl kickstart -k gui/$(id -u)/ai.nanoclaw.agent", { stdio: "pipe", timeout: 15e3 });
1531
+ console.log("NanoClaw restarted.");
1518
1532
  } catch {
1519
1533
  try {
1520
1534
  (0, import_node_child_process3.execSync)("systemctl --user restart nanoclaw", { stdio: "pipe", timeout: 15e3 });
1535
+ console.log("NanoClaw restarted.");
1521
1536
  } catch {
1522
- console.log("Warning: Could not restart NanoClaw. Restart it manually.");
1537
+ console.log("\n*** NanoClaw needs a manual restart. ***");
1538
+ console.log("*** macOS: launchctl kickstart -k gui/$(id -u)/ai.nanoclaw.agent ***");
1539
+ console.log("*** Linux: systemctl --user restart nanoclaw ***\n");
1523
1540
  }
1524
1541
  }
1525
1542
  }
@@ -1587,12 +1604,26 @@ async function start() {
1587
1604
  become proxy running on localhost:${config.proxy_port}`);
1588
1605
  console.log(`become dashboard at http://localhost:${config.dashboard_port}`);
1589
1606
  console.log(`
1590
- Skills loaded: ${approved} approved, ${pending} pending`);
1607
+ Connected to: ${config.agent_type}${config.openclaw_agent_id ? ` (agent: ${config.openclaw_agent_id})` : ""}`);
1608
+ console.log(`Skills loaded: ${approved} approved, ${pending} pending`);
1591
1609
  console.log(`Trust rules: ${trustConfig.trusted.length} trusted, ${trustConfig.blocked.length} blocked`);
1592
1610
  console.log("\nYour agent is learning from other agents.");
1593
1611
  console.log("Dashboard: http://localhost:" + config.dashboard_port);
1594
- console.log("Ctrl+C to stop.\n");
1612
+ console.log("Ctrl+C to stop.");
1613
+ setTimeout(() => {
1614
+ if (proxy.stats.requests_forwarded === 0) {
1615
+ console.log("\nWaiting for first request from your agent...");
1616
+ console.log("(If nothing happens, make sure your agent is running and talking to other agents)");
1617
+ }
1618
+ }, 1e4);
1619
+ const activityInterval = setInterval(() => {
1620
+ const s = proxy.stats;
1621
+ if (s.requests_forwarded > 0) {
1622
+ console.log(`[become] ${s.requests_forwarded} requests forwarded, ${s.skills_injected} skills injected, ${s.lessons_extracted} lessons extracted`);
1623
+ }
1624
+ }, 6e4);
1595
1625
  const shutdown = async () => {
1626
+ clearInterval(activityInterval);
1596
1627
  console.log("\nShutting down...");
1597
1628
  try {
1598
1629
  turnOff();