@highway1/cli 0.1.39 → 0.1.41

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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../dist/index.js';
package/dist/index.js CHANGED
@@ -118408,13 +118408,25 @@ function registerJoinCommand(program2) {
118408
118408
  await dht.publishAgentCard(signedCard);
118409
118409
  cardSpin.succeed("Agent Card published!");
118410
118410
  const pingInterval = setInterval(async () => {
118411
- for (const peer of node.libp2p.getPeers()) {
118412
- try {
118413
- await node.libp2p.services.ping.ping(peer);
118414
- } catch {
118411
+ const peers = node.libp2p.getPeers();
118412
+ if (peers.length === 0) {
118413
+ for (const bootstrapAddr of bootstrapPeers) {
118414
+ try {
118415
+ await node.libp2p.dial(bootstrapAddr);
118416
+ info("Reconnected to bootstrap peer");
118417
+ break;
118418
+ } catch {
118419
+ }
118420
+ }
118421
+ } else {
118422
+ for (const peer of peers) {
118423
+ try {
118424
+ await node.libp2p.services.ping.ping(peer);
118425
+ } catch {
118426
+ }
118415
118427
  }
118416
118428
  }
118417
- }, 3e4);
118429
+ }, 15e3);
118418
118430
  const verifyFn = async (signature, data) => {
118419
118431
  try {
118420
118432
  const decoded = JSON.parse(new TextDecoder().decode(data));