@camera.ui/browser 0.0.203 → 0.1.1
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.d.ts +62 -20
- package/dist/index.js +2507 -647
- package/package.json +20 -20
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { AssistantAccess } from '@camera.ui/sdk';
|
|
2
|
+
import type { AssistantAskResult } from '@camera.ui/sdk';
|
|
1
3
|
import type { AssistantToolReference } from '@camera.ui/sdk';
|
|
2
4
|
import { AudioProperty } from '@camera.ui/sdk';
|
|
3
5
|
import { AudioSensorProperties } from '@camera.ui/sdk';
|
|
@@ -110,20 +112,25 @@ import { WsTransport } from '@camera.ui/transport/transports/ws';
|
|
|
110
112
|
|
|
111
113
|
export declare function acquireSensorManager(rpcOrContext: RPCClient | ReactiveCameraDeviceContext): CachedSensorManager;
|
|
112
114
|
|
|
115
|
+
export declare type ActiveStreamingMode = Exclude<VideoStreamingMode, 'auto'> | 'mjpeg';
|
|
116
|
+
|
|
113
117
|
export declare interface ActivityMode extends ActivityModeState, ActivityModeActions {
|
|
114
118
|
}
|
|
115
119
|
|
|
116
120
|
declare interface ActivityModeActions {
|
|
117
121
|
setMode: (mode: CameraActivityMode) => void;
|
|
122
|
+
engage: () => void;
|
|
118
123
|
reportActivity: (hasActivity: boolean) => void;
|
|
119
124
|
resumeFromStandby: () => void;
|
|
120
125
|
resetIdleTimer: () => void;
|
|
126
|
+
setKeepAwake: (awake: boolean) => void;
|
|
121
127
|
dispose: () => void;
|
|
122
128
|
}
|
|
123
129
|
|
|
124
130
|
export declare interface ActivityModeConfig {
|
|
125
131
|
standbyTimeout?: number;
|
|
126
132
|
activityTimeout?: number;
|
|
133
|
+
wakeTimeout?: number;
|
|
127
134
|
}
|
|
128
135
|
|
|
129
136
|
declare interface ActivityModeState {
|
|
@@ -132,13 +139,6 @@ declare interface ActivityModeState {
|
|
|
132
139
|
readonly hasActivity: Ref<boolean>;
|
|
133
140
|
}
|
|
134
141
|
|
|
135
|
-
declare interface AssistantAccess {
|
|
136
|
-
allowed: boolean;
|
|
137
|
-
model: string | null;
|
|
138
|
-
vision: boolean | null;
|
|
139
|
-
language: string | null;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
142
|
declare interface AssistantAskRequest {
|
|
143
143
|
pluginId: string;
|
|
144
144
|
prompt: string;
|
|
@@ -148,10 +148,6 @@ declare interface AssistantAskRequest {
|
|
|
148
148
|
timeoutMs?: number;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
declare type AssistantAskResult =
|
|
152
|
-
| { ok: true; text: string; json?: unknown; usage: { promptTokens: number; completionTokens: number } }
|
|
153
|
-
| { ok: false; reason: 'not_allowed' | 'unconfigured' | 'timeout' | 'error'; message: string };
|
|
154
|
-
|
|
155
151
|
declare interface AssistantPost {
|
|
156
152
|
userId: string;
|
|
157
153
|
threadId: string;
|
|
@@ -182,7 +178,6 @@ export declare interface BaseLogger {
|
|
|
182
178
|
|
|
183
179
|
declare interface CachedSensorManager {
|
|
184
180
|
manager: ReactiveSensorManager;
|
|
185
|
-
initPromise?: Promise<void>;
|
|
186
181
|
}
|
|
187
182
|
|
|
188
183
|
export declare const CAMERA_UI_INJECTION_KEY: InjectionKey<CameraUiContext>;
|
|
@@ -196,7 +191,7 @@ export declare interface CameraDeviceInterface extends CameraDeviceImplementatio
|
|
|
196
191
|
connect(): Promise<void>;
|
|
197
192
|
disconnect(): Promise<void>;
|
|
198
193
|
snapshot(sourceId: string, forceNew?: boolean, preferNative?: boolean): Promise<ArrayBuffer | undefined>;
|
|
199
|
-
snapshotWithMeta(sourceId: string, forceNew?: boolean): Promise<SnapshotWithMeta | undefined>;
|
|
194
|
+
snapshotWithMeta(sourceId: string, forceNew?: boolean, knownFetchedAt?: number): Promise<SnapshotWithMeta | undefined>;
|
|
200
195
|
probeStream(sourceId: string, probeConfig?: ProbeConfig, refresh?: boolean): Promise<ProbeStream | undefined>;
|
|
201
196
|
getStreamStatus(sourceId: string): Promise<string>;
|
|
202
197
|
}
|
|
@@ -205,13 +200,15 @@ declare type CameraIdentifier = MaybeRefOrGetter<string | ReactiveCameraDevice |
|
|
|
205
200
|
|
|
206
201
|
export declare interface CameraNamespaces {
|
|
207
202
|
cameraSubject: string;
|
|
203
|
+
cameraStateSubject: string;
|
|
208
204
|
cameraControllerRpc: string;
|
|
209
205
|
}
|
|
210
206
|
|
|
211
207
|
export declare interface CameraStream {
|
|
212
208
|
readonly status: Ref<StreamStatus>;
|
|
213
209
|
readonly isPlaying: Ref<boolean>;
|
|
214
|
-
readonly
|
|
210
|
+
readonly stalled: Ref<boolean>;
|
|
211
|
+
readonly activeMode: Ref<ActiveStreamingMode>;
|
|
215
212
|
readonly activeResolution: Ref<StreamingRole>;
|
|
216
213
|
readonly degradedFrom: Ref<StreamingRole | null>;
|
|
217
214
|
readonly unsupported: Ref<boolean>;
|
|
@@ -247,6 +244,8 @@ export declare interface CameraStream {
|
|
|
247
244
|
setMicrophone: (track: MediaStreamTrack | null) => Promise<void>;
|
|
248
245
|
setActivityMode: (mode: CameraActivityMode) => void;
|
|
249
246
|
reportActivity: (hasActivity: boolean) => void;
|
|
247
|
+
resetIdleTimer: () => void;
|
|
248
|
+
setKeepAwake: (awake: boolean) => void;
|
|
250
249
|
setMuted: (muted: boolean) => void;
|
|
251
250
|
play: () => Promise<void>;
|
|
252
251
|
pause: () => void;
|
|
@@ -257,6 +256,7 @@ export declare interface CameraStream {
|
|
|
257
256
|
|
|
258
257
|
export declare interface CameraUiContext {
|
|
259
258
|
rpc: ShallowRef<RPCClient | undefined>;
|
|
259
|
+
bulkRpc?: ShallowRef<RPCClient | undefined>;
|
|
260
260
|
target: Readonly<Ref<ConnectionTarget | null>>;
|
|
261
261
|
isConnected: Readonly<Ref<boolean>>;
|
|
262
262
|
endpoint: Readonly<Ref<string | undefined>>;
|
|
@@ -276,6 +276,7 @@ export declare type CameraUiPlugin = ReturnType<typeof createCameraUiPlugin>;
|
|
|
276
276
|
|
|
277
277
|
export declare interface CameraUiPluginInput {
|
|
278
278
|
natsTransport: NatsTransport;
|
|
279
|
+
bulkTransport?: NatsTransport;
|
|
279
280
|
target: Ref<ConnectionTarget | null>;
|
|
280
281
|
wsTransport?: WsTransport;
|
|
281
282
|
}
|
|
@@ -325,6 +326,8 @@ export declare interface CoreManagerInterface {
|
|
|
325
326
|
getFFmpegPath(): Promise<string>;
|
|
326
327
|
getServerAddresses(pluginId?: string): Promise<string[]>;
|
|
327
328
|
getCloudServerId(): Promise<string>;
|
|
329
|
+
getRestoreGeneration(): Promise<string>;
|
|
330
|
+
getInstanceId(): Promise<string>;
|
|
328
331
|
getPlugin(pluginName: string): Promise<HostPluginInfo | undefined>;
|
|
329
332
|
getPluginsByInterface(interfaceName: PluginInterface): Promise<HostPluginInfo[]>;
|
|
330
333
|
getFloorPlan(): Promise<FloorPlan>;
|
|
@@ -361,6 +364,7 @@ export declare function createSensorManager(rpcOrContext: RPCClient | ReactiveCa
|
|
|
361
364
|
declare interface DBCamera extends BaseCamera {
|
|
362
365
|
sources: CameraInputSettings[];
|
|
363
366
|
workerAgentId?: string;
|
|
367
|
+
workerOnly?: boolean;
|
|
364
368
|
roomId: string | null;
|
|
365
369
|
}
|
|
366
370
|
|
|
@@ -641,6 +645,7 @@ export declare class NamespaceManager {
|
|
|
641
645
|
static cameraNamespaces(cameraId: string): CameraNamespaces {
|
|
642
646
|
return {
|
|
643
647
|
cameraSubject: `camera.${cameraId}.subscriber`,
|
|
648
|
+
cameraStateSubject: `camera.${cameraId}.state`,
|
|
644
649
|
cameraControllerRpc: `camera.${cameraId}.controller.rpc`,
|
|
645
650
|
};
|
|
646
651
|
}
|
|
@@ -682,6 +687,7 @@ export declare class NamespaceManager {
|
|
|
682
687
|
static sensorEventNamespaces(sensorId: string): SensorEventNamespaces {
|
|
683
688
|
return {
|
|
684
689
|
sensorSubject: `sensor.${sensorId}.subject`,
|
|
690
|
+
sensorStateSubject: `sensor.${sensorId}.state`,
|
|
685
691
|
};
|
|
686
692
|
}
|
|
687
693
|
|
|
@@ -726,7 +732,11 @@ export declare class NamespaceManager {
|
|
|
726
732
|
return `worker.${agentId}.rpc`;
|
|
727
733
|
}
|
|
728
734
|
|
|
729
|
-
static workerManagerRpc(): string {
|
|
735
|
+
static workerManagerRpc(agentId: string): string {
|
|
736
|
+
return `workers.${agentId}.manager.rpc`;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
static sharedWorkerManagerRpc(): string {
|
|
730
740
|
return 'workers.manager.rpc';
|
|
731
741
|
}
|
|
732
742
|
|
|
@@ -734,13 +744,29 @@ export declare class NamespaceManager {
|
|
|
734
744
|
return `worker.${agentId}.sync`;
|
|
735
745
|
}
|
|
736
746
|
|
|
737
|
-
static
|
|
747
|
+
static workerLinkSubject(agentId: string): string {
|
|
748
|
+
return `worker.${agentId}.link`;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
static workerDisconnect(agentId: string): string {
|
|
752
|
+
return `workers.${agentId}.disconnect`;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
static sharedWorkerDisconnect(): string {
|
|
738
756
|
return 'workers.disconnect';
|
|
739
757
|
}
|
|
740
758
|
|
|
741
|
-
static workerLogs(): string {
|
|
759
|
+
static workerLogs(agentId: string): string {
|
|
760
|
+
return `workers.${agentId}.logs`;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
static sharedWorkerLogs(): string {
|
|
742
764
|
return 'workers.logs';
|
|
743
765
|
}
|
|
766
|
+
|
|
767
|
+
static workerConnId(agentId: string, secret: string): string {
|
|
768
|
+
return createHmac('sha256', secret).update(agentId).digest('hex').slice(0, 32);
|
|
769
|
+
}
|
|
744
770
|
}
|
|
745
771
|
|
|
746
772
|
export { NatsStatus }
|
|
@@ -849,6 +875,7 @@ export declare interface ReactiveCameraDevice {
|
|
|
849
875
|
|
|
850
876
|
declare interface ReactiveCameraDeviceContext {
|
|
851
877
|
rpc: ShallowRef<RPCClient | undefined>;
|
|
878
|
+
bulkRpc?: ShallowRef<RPCClient | undefined>;
|
|
852
879
|
}
|
|
853
880
|
|
|
854
881
|
export declare interface ReactiveCarbonDioxideInfo extends ReactiveSensor<CarbonDioxideInfoProperties> {
|
|
@@ -1090,7 +1117,7 @@ export declare interface ReactiveStorage {
|
|
|
1090
1117
|
|
|
1091
1118
|
export declare interface ReactiveStream {
|
|
1092
1119
|
readonly status: Ref<StreamStatus>;
|
|
1093
|
-
readonly activeMode: Ref<
|
|
1120
|
+
readonly activeMode: Ref<ActiveStreamingMode>;
|
|
1094
1121
|
readonly requestedMode: Ref<VideoStreamingMode>;
|
|
1095
1122
|
readonly activeResolution: Ref<StreamingRole>;
|
|
1096
1123
|
readonly requestedResolution: Ref<StreamingRole>;
|
|
@@ -1101,6 +1128,7 @@ export declare interface ReactiveStream {
|
|
|
1101
1128
|
readonly hasAudio: Ref<boolean>;
|
|
1102
1129
|
readonly hasBackchannel: Ref<boolean>;
|
|
1103
1130
|
readonly isPlaying: Ref<boolean>;
|
|
1131
|
+
readonly stalled?: Ref<boolean>;
|
|
1104
1132
|
readonly error: Ref<Error | undefined>;
|
|
1105
1133
|
readonly probeInfo: Ref<ProbeStream | undefined>;
|
|
1106
1134
|
readonly muted: Ref<boolean>;
|
|
@@ -1110,6 +1138,7 @@ export declare interface ReactiveStream {
|
|
|
1110
1138
|
start: () => Promise<void>;
|
|
1111
1139
|
stop: () => void;
|
|
1112
1140
|
restart: () => Promise<void>;
|
|
1141
|
+
invalidateProbe: () => void;
|
|
1113
1142
|
setMode: (mode: VideoStreamingMode) => Promise<void>;
|
|
1114
1143
|
setResolution: (resolution: StreamingRole) => Promise<void>;
|
|
1115
1144
|
setMicrophone: (track: MediaStreamTrack | null) => Promise<void>;
|
|
@@ -1151,12 +1180,15 @@ declare interface RefreshedStates {
|
|
|
1151
1180
|
cameraState: boolean;
|
|
1152
1181
|
frameWorkerState: boolean;
|
|
1153
1182
|
sensorStates: Record<string, SensorRefreshedState>;
|
|
1183
|
+
stateSubject?: boolean;
|
|
1154
1184
|
}
|
|
1155
1185
|
|
|
1156
1186
|
export declare function releaseSensorManager(): void;
|
|
1157
1187
|
|
|
1158
1188
|
export declare function resetClientState(): void;
|
|
1159
1189
|
|
|
1190
|
+
export declare function restartConnectedStreams(): number;
|
|
1191
|
+
|
|
1160
1192
|
export declare function rpcCall<T>(rpcRef: Readonly<ShallowRef<RPCClient | undefined>>, fn: (rpc: RPCClient) => Promise<T>, options?: RpcCallOptions): Promise<T>;
|
|
1161
1193
|
|
|
1162
1194
|
export declare interface RpcCallOptions {
|
|
@@ -1165,6 +1197,7 @@ export declare interface RpcCallOptions {
|
|
|
1165
1197
|
connectTimeoutMs?: number;
|
|
1166
1198
|
retryDelayMs?: (attempt: number) => number;
|
|
1167
1199
|
shouldRetry?: (err: unknown, attempt: number) => boolean;
|
|
1200
|
+
retryOnTimeout?: boolean;
|
|
1168
1201
|
signal?: AbortSignal;
|
|
1169
1202
|
}
|
|
1170
1203
|
|
|
@@ -1199,6 +1232,7 @@ declare interface SensorConnectedChangedEvent {
|
|
|
1199
1232
|
sensorId: string;
|
|
1200
1233
|
sensorType: SensorType;
|
|
1201
1234
|
connected: boolean;
|
|
1235
|
+
assignedCameraIds?: string[];
|
|
1202
1236
|
}
|
|
1203
1237
|
|
|
1204
1238
|
declare interface SensorDeletedEvent {
|
|
@@ -1222,6 +1256,7 @@ export declare interface SensorEventMessage {
|
|
|
1222
1256
|
|
|
1223
1257
|
export declare interface SensorEventNamespaces {
|
|
1224
1258
|
sensorSubject: string;
|
|
1259
|
+
sensorStateSubject: string;
|
|
1225
1260
|
}
|
|
1226
1261
|
|
|
1227
1262
|
declare interface SensorExposedChangedEvent {
|
|
@@ -1268,8 +1303,10 @@ export declare function setFullscreenRoot(el: HTMLElement | null): void;
|
|
|
1268
1303
|
/* Excluded from this release type: SmokeSensorProperties */
|
|
1269
1304
|
|
|
1270
1305
|
declare interface SnapshotWithMeta {
|
|
1271
|
-
data
|
|
1306
|
+
data?: ArrayBuffer;
|
|
1272
1307
|
ageMs: number;
|
|
1308
|
+
fetchedAt?: number;
|
|
1309
|
+
notModified?: boolean;
|
|
1273
1310
|
}
|
|
1274
1311
|
|
|
1275
1312
|
export declare interface StorageRPC {
|
|
@@ -1315,6 +1352,7 @@ export declare const STREAM_CONFIG: {
|
|
|
1315
1352
|
readonly MSE: {
|
|
1316
1353
|
readonly BUFFER_SIZE: number;
|
|
1317
1354
|
readonly BUFFER_WINDOW: 5;
|
|
1355
|
+
readonly MAX_BUFFER_WINDOW: 60;
|
|
1318
1356
|
};
|
|
1319
1357
|
readonly CODECS: {
|
|
1320
1358
|
readonly DEFAULT: readonly ["avc1.640029", "avc1.64002A", "avc1.640033", "hvc1.1.6.L153.B0", "mp4a.40.2", "mp4a.40.5", "flac", "opus"];
|
|
@@ -1478,7 +1516,11 @@ export declare interface UseOAuthReturn {
|
|
|
1478
1516
|
|
|
1479
1517
|
export declare function useObjectSensor(camera: CameraIdentifier, preferredPluginId?: MaybeRefOrGetter<string | undefined>): UseSensorTypedReturn<ReactiveObjectSensor>;
|
|
1480
1518
|
|
|
1481
|
-
export declare function usePlugin(pluginName: MaybeRefOrGetter<string
|
|
1519
|
+
export declare function usePlugin(pluginName: MaybeRefOrGetter<string>, options?: UsePluginOptions): UsePluginReturn;
|
|
1520
|
+
|
|
1521
|
+
export declare interface UsePluginOptions {
|
|
1522
|
+
lane?: 'main' | 'bulk';
|
|
1523
|
+
}
|
|
1482
1524
|
|
|
1483
1525
|
export declare interface UsePluginReturn {
|
|
1484
1526
|
plugin: ShallowRef<Promisify<BasePlugin & PluginInterfaces> | undefined>;
|