@exagent/agent 0.1.7 → 0.1.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/chunk-ONWRXGJG.mjs +2678 -0
- package/dist/cli.js +7 -2
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -2
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1388,6 +1388,7 @@ var RelayClient = class {
|
|
|
1388
1388
|
config;
|
|
1389
1389
|
ws = null;
|
|
1390
1390
|
authenticated = false;
|
|
1391
|
+
authRejected = false;
|
|
1391
1392
|
reconnectAttempts = 0;
|
|
1392
1393
|
maxReconnectAttempts = 50;
|
|
1393
1394
|
reconnectTimer = null;
|
|
@@ -1420,8 +1421,8 @@ var RelayClient = class {
|
|
|
1420
1421
|
}
|
|
1421
1422
|
}, 15e3);
|
|
1422
1423
|
this.ws.on("open", async () => {
|
|
1424
|
+
this.authRejected = false;
|
|
1423
1425
|
console.log("Relay: Connected, authenticating...");
|
|
1424
|
-
this.reconnectAttempts = 0;
|
|
1425
1426
|
try {
|
|
1426
1427
|
await this.authenticate();
|
|
1427
1428
|
} catch (error) {
|
|
@@ -1438,11 +1439,13 @@ var RelayClient = class {
|
|
|
1438
1439
|
if (data.type === "auth_success") {
|
|
1439
1440
|
clearTimeout(connectTimeout);
|
|
1440
1441
|
this.authenticated = true;
|
|
1442
|
+
this.reconnectAttempts = 0;
|
|
1441
1443
|
this.startHeartbeat();
|
|
1442
1444
|
console.log("Relay: Authenticated successfully");
|
|
1443
1445
|
resolve();
|
|
1444
1446
|
} else if (data.type === "auth_error") {
|
|
1445
1447
|
clearTimeout(connectTimeout);
|
|
1448
|
+
this.authRejected = true;
|
|
1446
1449
|
console.error(`Relay: Auth rejected: ${data.message}`);
|
|
1447
1450
|
reject(new Error(data.message));
|
|
1448
1451
|
}
|
|
@@ -1454,7 +1457,9 @@ var RelayClient = class {
|
|
|
1454
1457
|
this.authenticated = false;
|
|
1455
1458
|
this.stopHeartbeat();
|
|
1456
1459
|
if (!this.stopped) {
|
|
1457
|
-
|
|
1460
|
+
if (!this.authRejected) {
|
|
1461
|
+
console.log(`Relay: Disconnected (${code}: ${reason.toString() || "unknown"})`);
|
|
1462
|
+
}
|
|
1458
1463
|
this.scheduleReconnect();
|
|
1459
1464
|
}
|
|
1460
1465
|
});
|
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1432,6 +1432,7 @@ var RelayClient = class {
|
|
|
1432
1432
|
config;
|
|
1433
1433
|
ws = null;
|
|
1434
1434
|
authenticated = false;
|
|
1435
|
+
authRejected = false;
|
|
1435
1436
|
reconnectAttempts = 0;
|
|
1436
1437
|
maxReconnectAttempts = 50;
|
|
1437
1438
|
reconnectTimer = null;
|
|
@@ -1464,8 +1465,8 @@ var RelayClient = class {
|
|
|
1464
1465
|
}
|
|
1465
1466
|
}, 15e3);
|
|
1466
1467
|
this.ws.on("open", async () => {
|
|
1468
|
+
this.authRejected = false;
|
|
1467
1469
|
console.log("Relay: Connected, authenticating...");
|
|
1468
|
-
this.reconnectAttempts = 0;
|
|
1469
1470
|
try {
|
|
1470
1471
|
await this.authenticate();
|
|
1471
1472
|
} catch (error) {
|
|
@@ -1482,11 +1483,13 @@ var RelayClient = class {
|
|
|
1482
1483
|
if (data.type === "auth_success") {
|
|
1483
1484
|
clearTimeout(connectTimeout);
|
|
1484
1485
|
this.authenticated = true;
|
|
1486
|
+
this.reconnectAttempts = 0;
|
|
1485
1487
|
this.startHeartbeat();
|
|
1486
1488
|
console.log("Relay: Authenticated successfully");
|
|
1487
1489
|
resolve();
|
|
1488
1490
|
} else if (data.type === "auth_error") {
|
|
1489
1491
|
clearTimeout(connectTimeout);
|
|
1492
|
+
this.authRejected = true;
|
|
1490
1493
|
console.error(`Relay: Auth rejected: ${data.message}`);
|
|
1491
1494
|
reject(new Error(data.message));
|
|
1492
1495
|
}
|
|
@@ -1498,7 +1501,9 @@ var RelayClient = class {
|
|
|
1498
1501
|
this.authenticated = false;
|
|
1499
1502
|
this.stopHeartbeat();
|
|
1500
1503
|
if (!this.stopped) {
|
|
1501
|
-
|
|
1504
|
+
if (!this.authRejected) {
|
|
1505
|
+
console.log(`Relay: Disconnected (${code}: ${reason.toString() || "unknown"})`);
|
|
1506
|
+
}
|
|
1502
1507
|
this.scheduleReconnect();
|
|
1503
1508
|
}
|
|
1504
1509
|
});
|
package/dist/index.mjs
CHANGED