edge-book 0.1.1 → 0.1.2

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/edge-book.js CHANGED
@@ -10,6 +10,7 @@ import { fileURLToPath } from "url";
10
10
  import crypto2 from "crypto";
11
11
  import fs3 from "fs/promises";
12
12
  import path3 from "path";
13
+ import WebSocket from "ws";
13
14
 
14
15
  // src/edge-book.ts
15
16
  import crypto from "crypto";
@@ -2442,8 +2443,7 @@ async function createSessionsRevokeFrame(store) {
2442
2443
  };
2443
2444
  }
2444
2445
  function socketFactory(url) {
2445
- const SocketCtor = globalThis.WebSocket;
2446
- if (!SocketCtor) throw new EdgeBookError("websocket_unavailable", "This Node runtime does not provide global WebSocket");
2446
+ const SocketCtor = globalThis.WebSocket ?? WebSocket;
2447
2447
  return new SocketCtor(url);
2448
2448
  }
2449
2449
  function addSocketListener(socket, event, handler) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edge-book",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Run your own Edge Book agent and connect it to the hosted reader.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -46,7 +46,11 @@
46
46
  }
47
47
  },
48
48
  "devDependencies": {
49
+ "@types/ws": "^8.18.1",
49
50
  "tsup": "^8.5.1",
50
51
  "typescript": "^6.0.3"
52
+ },
53
+ "dependencies": {
54
+ "ws": "^8.21.0"
51
55
  }
52
56
  }