@camstack/sdk 0.1.54 → 0.1.56

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/system.d.ts CHANGED
@@ -11,7 +11,7 @@
11
11
  * — a future phase will narrow the surface further.
12
12
  */
13
13
  import { createWSClient, type TRPCClient } from '@trpc/client';
14
- import type { DeviceProxy, DeviceQueryFilters, DeviceLifecycleListener, SystemProxy } from '@camstack/types';
14
+ import type { DeviceProxy, DeviceInfo, DeviceQueryFilters, DeviceLifecycleListener, SystemProxy } from '@camstack/types';
15
15
  import type { BackendAppRouter } from './backend-router.js';
16
16
  import type { BackendConnectionState } from './types.js';
17
17
  /**
@@ -232,6 +232,19 @@ export declare class System {
232
232
  * make a separate `deviceManager.getBindings` round-trip.
233
233
  */
234
234
  listDevices(filters?: DeviceQueryFilters): readonly DeviceProxy[];
235
+ /**
236
+ * Sync `DeviceInfo` snapshot (name, canonical type, online, …) for one device
237
+ * from the warm-boot mirror — `null` if the mirror isn't booted or the device
238
+ * is unknown. Unlike a `DeviceProxy` (cap accessors only), this carries the
239
+ * display identity the UI needs to render a device on first paint.
240
+ */
241
+ getDeviceInfo(deviceId: number): DeviceInfo | null;
242
+ /**
243
+ * The `DeviceInfo` snapshots for the current device set (the warm-boot cache),
244
+ * honouring the same `filters` as {@link listDevices}. Lets a UI render a named
245
+ * device list immediately without waiting for per-device lifecycle events.
246
+ */
247
+ listDeviceInfos(filters?: DeviceQueryFilters): readonly DeviceInfo[];
235
248
  /**
236
249
  * Sync lookup by numeric id. `null` if the mirror has not been booted
237
250
  * or the device is unknown.
@@ -276,8 +289,6 @@ export declare class System {
276
289
  get pipelineExecutor(): SystemProxy['pipelineExecutor'];
277
290
  get pipelineOrchestrator(): SystemProxy['pipelineOrchestrator'];
278
291
  get pipelineRunner(): SystemProxy['pipelineRunner'];
279
- get platformProbe(): SystemProxy['platformProbe'];
280
- get recordingEngine(): SystemProxy['recordingEngine'];
281
292
  get settingsStore(): SystemProxy['settingsStore'];
282
293
  get storage(): SystemProxy['storage'];
283
294
  get streamBroker(): SystemProxy['streamBroker'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/sdk",
3
- "version": "0.1.54",
3
+ "version": "0.1.56",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -1,91 +0,0 @@
1
- /**
2
- * Adaptive Stream Session — negotiates optimal stream quality with the proxy.
3
- *
4
- * The client reports viewport size and network conditions periodically.
5
- * The proxy selects the best stream from the provider's available streams
6
- * and instructs the client to switch via go2rtc stream renegotiation.
7
- *
8
- * Flow:
9
- * 1. Client opens session → sends initial constraints (viewport, network)
10
- * 2. Server evaluates available streams → picks optimal → responds with stream assignment
11
- * 3. Client connects to assigned go2rtc stream via WebRTC WHEP
12
- * 4. Periodically, client reports updated stats → server may switch stream
13
- * 5. On switch: client tears down old PC, creates new PC to new go2rtc stream
14
- */
15
- /** Client-reported constraints for stream selection. */
16
- export interface StreamConstraints {
17
- /** Viewport width in CSS pixels. */
18
- viewportWidth: number;
19
- /** Viewport height in CSS pixels. */
20
- viewportHeight: number;
21
- /** Device pixel ratio (retina = 2+). */
22
- pixelRatio?: number;
23
- /** Estimated downlink bandwidth in Mbps (from navigator.connection or WebRTC stats). */
24
- bandwidthMbps?: number;
25
- /** Round-trip time in ms (from WebRTC stats). */
26
- rttMs?: number;
27
- /** Packet loss ratio 0-1 (from WebRTC stats). */
28
- packetLoss?: number;
29
- /** Whether the client is on a cellular network. */
30
- isCellular?: boolean;
31
- /** Whether the client prefers low latency over quality. */
32
- preferLowLatency?: boolean;
33
- /** Maximum resolution the client wants (e.g., from a user setting). */
34
- maxResolution?: "auto" | "high" | "medium" | "low";
35
- }
36
- /** Server-assigned stream for the client. */
37
- export interface StreamAssignment {
38
- /** go2rtc stream name to connect to. */
39
- streamName: string;
40
- /** Stream profile (main/sub/ext). */
41
- profile: string;
42
- /** Transport type (native/rtsp/rtmp). */
43
- transport: string;
44
- /** Human-readable label. */
45
- label: string;
46
- /** Stream metadata (if known). */
47
- metadata?: {
48
- width?: number;
49
- height?: number;
50
- fps?: number;
51
- bitrate?: number;
52
- codec?: string;
53
- };
54
- /** Reason for this selection. */
55
- reason: string;
56
- }
57
- /** Stream selection request from client → server. */
58
- export interface StreamSelectionRequest {
59
- providerId: string;
60
- camera: string;
61
- constraints: StreamConstraints;
62
- /** Current stream (for comparison — only switch if significantly better). */
63
- currentStreamName?: string;
64
- }
65
- /** Stream selection response from server → client. */
66
- export interface StreamSelectionResponse {
67
- assignment: StreamAssignment;
68
- /** Available alternatives the client can manually pick. */
69
- alternatives: StreamAssignment[];
70
- /** Seconds until next automatic re-evaluation. */
71
- nextEvalSeconds: number;
72
- }
73
- /**
74
- * Select the optimal stream from available options based on client constraints.
75
- * This is a pure function — no side effects.
76
- */
77
- export declare function selectOptimalStream(streams: Array<{
78
- streamName: string;
79
- profile: string;
80
- transport: string;
81
- label: string;
82
- metadata?: {
83
- width?: number;
84
- height?: number;
85
- fps?: number;
86
- bitrate?: number;
87
- codec?: string;
88
- };
89
- }>, constraints: StreamConstraints, defaultTransport?: string): StreamAssignment | null;
90
- /** Determine seconds until next re-evaluation based on stability. */
91
- export declare function getNextEvalInterval(constraints: StreamConstraints, wasSwitch: boolean): number;