@mega-yfue/eufy-sdk 0.5.0-beta.6 → 0.5.0-beta.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.
@@ -258,11 +258,14 @@ export declare class P2PCommandRouter {
258
258
  */
259
259
  dispatchCommand(sn: string, cmd: Command): Promise<void>;
260
260
  /**
261
- * Restart a HomeBase. `RESTART_HUB` (1034) is a station-scalar on the broadcast channel 255: a
262
- * level-2 frame whose body is `[u32 value][account_id padded]` — the same shape as the hub
263
- * alarm-volume control. ✅ Wire-confirmed byte-exact from a capture of the app's own Restart
264
- * (2026-08-03) and HW-tested: the captured frame carried value `0` and rebooted the hub. Replays
265
- * like every other level-2 control, so a single dropped datagram doesn't lose it.
261
+ * Restart the station that owns `sn`'s P2P session. `RESTART_HUB` (1034) is a station-scalar on the
262
+ * broadcast channel 255 whose body is `[u32 value][account_id padded]`, value `0`. ✅ Wire-confirmed
263
+ * byte-exact as a level-2 frame from a capture of the app's own HomeBase Restart (2026-08-03).
264
+ *
265
+ * The seal follows the session, as {@link sendBySessionLevel} defines it: a keyed session takes the
266
+ * level-2 frame, a keyless one — a standalone camera, which never negotiates a key — the same body
267
+ * sealed level-1. Both are replayed {@link DIRECT_CMD_SENDS}× at 200ms, as every other unacknowledged
268
+ * control here is.
266
269
  */
267
270
  rebootStation(sn: string): Promise<void>;
268
271
  /**
@@ -103,6 +103,9 @@ export declare class LiveStream extends EventEmitter {
103
103
  private lastCodec;
104
104
  /** Rebuilds an access unit the station split across several frames — see {@link AccessUnitAssembler}. */
105
105
  private readonly units;
106
+ /** Whether a missing video datagram or incomplete unit invalidated the current reference chain. */
107
+ private awaitingKeyframeAfterGap;
108
+ private readonly videoGapHandler;
106
109
  /** The channel inbound media must be tagged with, once {@link acceptsMedia} trusts the station's tag. */
107
110
  private mediaChannel?;
108
111
  private tracedFirstVideoCommand;
@@ -435,6 +435,11 @@ export declare class P2PSession extends EventEmitter {
435
435
  * "direct" commands (e.g. CAMERA_SWITCH 1035) carry a binary struct, not JSON.
436
436
  */
437
437
  sendRawLevel2Bytes(payload: Buffer, channel: number, outerCmd?: number, signCode?: number): boolean;
438
+ /**
439
+ * The level-1 twin of {@link sendRawLevel2Bytes}: the plaintext `payload` sealed AES-128-ECB under the
440
+ * level-1 key, signCode 1 — the seal of the level-1 media start. Returns `false` when not connected.
441
+ */
442
+ sendRawLevel1Bytes(payload: Buffer, channel: number, outerCmd: number): boolean;
438
443
  /**
439
444
  * Stop the realtime media stream (`CMD_STOP_REALTIME_MEDIA`, 1004) on a camera `channel`, in the shape
440
445
  * its runtime topology takes, as {@link startLiveMedia} selects its start:
@@ -144,9 +144,10 @@ export declare class AccessUnitAssembler {
144
144
  * `decode` extracts the payload of a frame, whatever the stream's encryption: it is called for EVERY
145
145
  * frame, including a continuation, because a continuation carries its own wrapped key ahead of its share
146
146
  * of the payload (measured: 129 bytes beyond what its header declares, exactly as a unit's first frame
147
- * carries).
147
+ * carries). A continuation without its matching open unit has no Annex-B start code and cannot be emitted
148
+ * as a complete unit, even if its repeated header says keyframe.
148
149
  */
149
150
  push(payload: Buffer, decode: (payload: Buffer) => Buffer | undefined): AssembledAccessUnit[];
150
151
  /** Forget an incomplete unit, counting and reporting it. */
151
- private discard;
152
+ discard(): void;
152
153
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mega-yfue/eufy-sdk",
3
- "version": "0.5.0-beta.6",
3
+ "version": "0.5.0-beta.8",
4
4
  "description": "One typed TypeScript client for the Anker eufy v6 cloud — capability-driven devices, realtime events over P2P/MQTT/push, and live media",
5
5
  "license": "Apache-2.0",
6
6
  "author": "mega-yfue",