@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 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
 
@@ -311,8 +317,7 @@ Proxy port (default 30001): `);
311
317
  };
312
318
  saveConfig(config);
313
319
  console.log("\nConfig saved to ~/.become/config.json");
314
- console.log("Run `become start` to start the proxy and dashboard.");
315
- console.log("Run `become on` to route your agent through become.\n");
320
+ console.log("Run `become start` to begin. Ctrl+C to stop.\n");
316
321
  } finally {
317
322
  rl.close();
318
323
  }
@@ -1437,10 +1442,13 @@ function patchIronClaw(config) {
1437
1442
  patchDotEnv(IRONCLAW_ENV, {
1438
1443
  LLM_BASE_URL: `http://127.0.0.1:${config.proxy_port}/v1`
1439
1444
  });
1445
+ console.log("Restarting IronClaw...");
1440
1446
  try {
1441
1447
  (0, import_node_child_process2.execSync)("ironclaw service restart", { stdio: "pipe", timeout: 15e3 });
1448
+ console.log("IronClaw restarted.");
1442
1449
  } catch {
1443
- 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");
1444
1452
  }
1445
1453
  }
1446
1454
  function restoreIronClaw() {
@@ -1448,10 +1456,13 @@ function restoreIronClaw() {
1448
1456
  throw new Error("No backup found. Was become ever turned on?");
1449
1457
  }
1450
1458
  (0, import_node_fs5.copyFileSync)(BACKUP_PATH2, IRONCLAW_ENV);
1459
+ console.log("Restarting IronClaw...");
1451
1460
  try {
1452
1461
  (0, import_node_child_process2.execSync)("ironclaw service restart", { stdio: "pipe", timeout: 15e3 });
1462
+ console.log("IronClaw restarted.");
1453
1463
  } catch {
1454
- 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");
1455
1466
  }
1456
1467
  }
1457
1468
  function patchDotEnv(path, vars) {
@@ -1514,13 +1525,18 @@ function findNanoClawEnv() {
1514
1525
  return null;
1515
1526
  }
1516
1527
  function restartNanoClaw() {
1528
+ console.log("Restarting NanoClaw...");
1517
1529
  try {
1518
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.");
1519
1532
  } catch {
1520
1533
  try {
1521
1534
  (0, import_node_child_process3.execSync)("systemctl --user restart nanoclaw", { stdio: "pipe", timeout: 15e3 });
1535
+ console.log("NanoClaw restarted.");
1522
1536
  } catch {
1523
- 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");
1524
1540
  }
1525
1541
  }
1526
1542
  }
@@ -1588,12 +1604,26 @@ async function start() {
1588
1604
  become proxy running on localhost:${config.proxy_port}`);
1589
1605
  console.log(`become dashboard at http://localhost:${config.dashboard_port}`);
1590
1606
  console.log(`
1591
- 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`);
1592
1609
  console.log(`Trust rules: ${trustConfig.trusted.length} trusted, ${trustConfig.blocked.length} blocked`);
1593
1610
  console.log("\nYour agent is learning from other agents.");
1594
1611
  console.log("Dashboard: http://localhost:" + config.dashboard_port);
1595
- 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);
1596
1625
  const shutdown = async () => {
1626
+ clearInterval(activityInterval);
1597
1627
  console.log("\nShutting down...");
1598
1628
  try {
1599
1629
  turnOff();