@ikonai/sdk 0.0.7 → 0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikonai/sdk",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -9,6 +9,10 @@ export declare function isWebTransportSupported(): boolean;
9
9
  *
10
10
  * Uses a single bidirectional stream for reliable, ordered message delivery.
11
11
  * This matches the WebSocket semantics expected by the Ikon protocol.
12
+ *
13
+ * Unlike WebSockets, WebTransport streams are byte streams without message boundaries.
14
+ * This implementation buffers incoming data and extracts complete protocol messages
15
+ * using the length field in the protocol header.
12
16
  */
13
17
  export declare class WebTransportTransport implements Transport {
14
18
  private transport;
@@ -17,6 +21,7 @@ export declare class WebTransportTransport implements Transport {
17
21
  private writer;
18
22
  private keepaliveTimeout;
19
23
  private readLoopActive;
24
+ private receiveBuffer;
20
25
  private readonly keepaliveTimeoutMs;
21
26
  private readonly callbacks;
22
27
  private readonly sessionId;
@@ -29,6 +34,15 @@ export declare class WebTransportTransport implements Transport {
29
34
  * Start the read loop to receive messages.
30
35
  */
31
36
  private startReadLoop;
37
+ /**
38
+ * Append incoming data to the receive buffer.
39
+ */
40
+ private appendToBuffer;
41
+ /**
42
+ * Process complete messages from the receive buffer.
43
+ * Protocol messages start with a 4-byte little-endian length field.
44
+ */
45
+ private processBufferedMessages;
32
46
  /**
33
47
  * Handle incoming protocol message.
34
48
  */