@openclawcity/become 1.0.4 → 1.0.8

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.js CHANGED
@@ -1535,6 +1535,13 @@ async function start() {
1535
1535
  }
1536
1536
  });
1537
1537
  await dashboard.listen(config.dashboard_port);
1538
+ if (config.state !== "on") {
1539
+ try {
1540
+ turnOn();
1541
+ } catch (e) {
1542
+ console.error("Warning: could not auto-connect agent:", e instanceof Error ? e.message : e);
1543
+ }
1544
+ }
1538
1545
  const approved = proxy.store.listApproved().length;
1539
1546
  const pending = proxy.store.listPending().length;
1540
1547
  const trustConfig = proxy.trust.getConfig();
@@ -1544,14 +1551,15 @@ become proxy running on localhost:${config.proxy_port}`);
1544
1551
  console.log(`
1545
1552
  Skills loaded: ${approved} approved, ${pending} pending`);
1546
1553
  console.log(`Trust rules: ${trustConfig.trusted.length} trusted, ${trustConfig.blocked.length} blocked`);
1547
- if (config.state === "on") {
1548
- console.log("\nProxy is ACTIVE \u2014 your agent is learning from other agents.");
1549
- } else {
1550
- console.log("\nProxy is IDLE \u2014 run `become on` to route your agent through become.");
1551
- }
1552
- console.log("Use `become off` to disconnect. Ctrl+C to stop.\n");
1554
+ console.log("\nYour agent is learning from other agents.");
1555
+ console.log("Dashboard: http://localhost:" + config.dashboard_port);
1556
+ console.log("Ctrl+C to stop.\n");
1553
1557
  const shutdown = async () => {
1554
1558
  console.log("\nShutting down...");
1559
+ try {
1560
+ turnOff();
1561
+ } catch {
1562
+ }
1555
1563
  await Promise.all([proxy.close(), dashboard.close()]);
1556
1564
  process.exit(0);
1557
1565
  };
@@ -1634,7 +1642,23 @@ Skills: ${approved} approved, ${pending} pending, ${rejected} rejected`);
1634
1642
  }
1635
1643
 
1636
1644
  // src/cli/init.ts
1645
+ import { readFileSync as readFileSync7 } from "fs";
1646
+ import { join as join7, dirname as dirname2 } from "path";
1647
+ import { fileURLToPath } from "url";
1637
1648
  var command = process.argv[2];
1649
+ var VERSION = "unknown";
1650
+ try {
1651
+ const dir = dirname2(fileURLToPath(import.meta.url));
1652
+ const pkgPath = join7(dir, "..", "package.json");
1653
+ VERSION = JSON.parse(readFileSync7(pkgPath, "utf-8")).version;
1654
+ } catch {
1655
+ try {
1656
+ const dir = dirname2(fileURLToPath(import.meta.url));
1657
+ const pkgPath = join7(dir, "..", "..", "package.json");
1658
+ VERSION = JSON.parse(readFileSync7(pkgPath, "utf-8")).version;
1659
+ } catch {
1660
+ }
1661
+ }
1638
1662
  async function main() {
1639
1663
  switch (command) {
1640
1664
  case "setup":
@@ -1652,19 +1676,22 @@ async function main() {
1652
1676
  case "status":
1653
1677
  showStatus();
1654
1678
  break;
1655
- case "init":
1656
- console.log("The `init` command is no longer needed. Use `become setup` instead.");
1679
+ case "--version":
1680
+ case "-v":
1681
+ case "version":
1682
+ console.log(`become v${VERSION}`);
1657
1683
  break;
1658
1684
  default:
1659
1685
  console.log(`
1660
- become \u2014 agent-to-agent learning
1686
+ become v${VERSION} \u2014 agent-to-agent learning
1661
1687
 
1662
1688
  Usage:
1663
- become setup Set up become (interactive wizard)
1664
- become start Start the proxy server
1665
- become on Route your agent through become
1666
- become off Disconnect \u2014 agent talks directly to LLM
1667
- become status Show current status
1689
+ become setup Set up become (interactive wizard)
1690
+ become start Start the proxy and dashboard
1691
+ become on Route your agent through become
1692
+ become off Disconnect \u2014 agent talks directly to LLM
1693
+ become status Show current status
1694
+ become --version Show version
1668
1695
  `);
1669
1696
  }
1670
1697
  }