@agentvault/agentvault 0.9.3 → 0.9.4

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/index.js CHANGED
@@ -46397,6 +46397,18 @@ var SecureChannel = class _SecureChannel extends EventEmitter {
46397
46397
  this.emit("error", openErr);
46398
46398
  }
46399
46399
  });
46400
+ const _onUnhandledRejection = (reason) => {
46401
+ console.error("[SecureChannel] UNHANDLED REJECTION (would crash process):", reason);
46402
+ };
46403
+ const _onUncaughtException = (err) => {
46404
+ console.error("[SecureChannel] UNCAUGHT EXCEPTION (would crash process):", err);
46405
+ };
46406
+ process.on("unhandledRejection", _onUnhandledRejection);
46407
+ process.on("uncaughtException", _onUncaughtException);
46408
+ ws.on("close", () => {
46409
+ process.removeListener("unhandledRejection", _onUnhandledRejection);
46410
+ process.removeListener("uncaughtException", _onUncaughtException);
46411
+ });
46400
46412
  ws.on("message", async (raw) => {
46401
46413
  this._lastServerMessage = Date.now();
46402
46414
  this._lastWakeTick = Date.now();