@ktfun/pulse-protocol 0.0.4

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.
@@ -0,0 +1,864 @@
1
+ import { z } from "zod";
2
+ export declare const DEVICE_CONNECTION_PROTOCOL = "device.connection.v1";
3
+ export declare const DEVICE_MEDIA_CONNECTION_PROTOCOL = "device.media.connection.v1";
4
+ export declare const DEVICE_MEDIA_PROTOCOL = "device.media.v1";
5
+ export declare const PRESENCE_PROTOCOL = "presence.v2";
6
+ export declare const DeviceCommonConnectionHelloFrameSchema: z.ZodObject<{
7
+ protocol: z.ZodLiteral<"device.connection.v1">;
8
+ type: z.ZodLiteral<"hello">;
9
+ payload: z.ZodObject<{
10
+ device: z.ZodObject<{
11
+ name: z.ZodString;
12
+ platform: z.ZodEnum<{
13
+ linux: "linux";
14
+ macos: "macos";
15
+ other: "other";
16
+ windows: "windows";
17
+ }>;
18
+ appVersion: z.ZodOptional<z.ZodString>;
19
+ mode: z.ZodOptional<z.ZodString>;
20
+ displayName: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>;
22
+ capabilities: z.ZodObject<{
23
+ focusApp: z.ZodBoolean;
24
+ windowTitle: z.ZodBoolean;
25
+ pageTitle: z.ZodBoolean;
26
+ pageUrl: z.ZodBoolean;
27
+ }, z.core.$strip>;
28
+ supportedProtocols: z.ZodArray<z.ZodString>;
29
+ }, z.core.$strip>;
30
+ }, z.core.$strip>;
31
+ export declare const DeviceCommonConnectionHelloAckFrameSchema: z.ZodObject<{
32
+ protocol: z.ZodLiteral<"device.connection.v1">;
33
+ type: z.ZodLiteral<"hello_ack">;
34
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
35
+ accepted: z.ZodLiteral<true>;
36
+ serverTime: z.ZodString;
37
+ connectionId: z.ZodString;
38
+ deviceSessionId: z.ZodString;
39
+ selectedProtocols: z.ZodArray<z.ZodString>;
40
+ }, z.core.$strip>, z.ZodObject<{
41
+ accepted: z.ZodLiteral<false>;
42
+ serverTime: z.ZodString;
43
+ error: z.ZodObject<{
44
+ code: z.ZodString;
45
+ message: z.ZodString;
46
+ }, z.core.$strip>;
47
+ }, z.core.$strip>], "accepted">;
48
+ }, z.core.$strip>;
49
+ export declare const CommonPresenceStateSchema: z.ZodObject<{
50
+ availability: z.ZodObject<{
51
+ state: z.ZodEnum<{
52
+ active: "active";
53
+ idle: "idle";
54
+ }>;
55
+ idleSeconds: z.ZodOptional<z.ZodNumber>;
56
+ }, z.core.$strip>;
57
+ focus: z.ZodObject<{
58
+ app: z.ZodOptional<z.ZodObject<{
59
+ name: z.ZodOptional<z.ZodString>;
60
+ id: z.ZodOptional<z.ZodString>;
61
+ category: z.ZodOptional<z.ZodString>;
62
+ window: z.ZodOptional<z.ZodObject<{
63
+ title: z.ZodOptional<z.ZodString>;
64
+ }, z.core.$strip>>;
65
+ page: z.ZodOptional<z.ZodObject<{
66
+ title: z.ZodOptional<z.ZodString>;
67
+ url: z.ZodOptional<z.ZodString>;
68
+ }, z.core.$strip>>;
69
+ }, z.core.$strip>>;
70
+ }, z.core.$strip>;
71
+ }, z.core.$strip>;
72
+ export declare const PresenceSnapshotFrameSchema: z.ZodObject<{
73
+ protocol: z.ZodLiteral<"presence.v2">;
74
+ type: z.ZodLiteral<"snapshot">;
75
+ payload: z.ZodObject<{
76
+ eventId: z.ZodString;
77
+ seq: z.ZodNumber;
78
+ observedAt: z.ZodString;
79
+ sentAt: z.ZodString;
80
+ state: z.ZodObject<{
81
+ availability: z.ZodObject<{
82
+ state: z.ZodEnum<{
83
+ active: "active";
84
+ idle: "idle";
85
+ }>;
86
+ idleSeconds: z.ZodOptional<z.ZodNumber>;
87
+ }, z.core.$strip>;
88
+ focus: z.ZodObject<{
89
+ app: z.ZodOptional<z.ZodObject<{
90
+ name: z.ZodOptional<z.ZodString>;
91
+ id: z.ZodOptional<z.ZodString>;
92
+ category: z.ZodOptional<z.ZodString>;
93
+ window: z.ZodOptional<z.ZodObject<{
94
+ title: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strip>>;
96
+ page: z.ZodOptional<z.ZodObject<{
97
+ title: z.ZodOptional<z.ZodString>;
98
+ url: z.ZodOptional<z.ZodString>;
99
+ }, z.core.$strip>>;
100
+ }, z.core.$strip>>;
101
+ }, z.core.$strip>;
102
+ }, z.core.$strip>;
103
+ }, z.core.$strip>;
104
+ }, z.core.$strip>;
105
+ export declare const PresenceHeartbeatFrameSchema: z.ZodObject<{
106
+ protocol: z.ZodLiteral<"presence.v2">;
107
+ type: z.ZodLiteral<"heartbeat">;
108
+ payload: z.ZodObject<{
109
+ eventId: z.ZodString;
110
+ seq: z.ZodNumber;
111
+ observedAt: z.ZodString;
112
+ sentAt: z.ZodString;
113
+ }, z.core.$strip>;
114
+ }, z.core.$strip>;
115
+ export declare const PresenceSessionEndFrameSchema: z.ZodObject<{
116
+ protocol: z.ZodLiteral<"presence.v2">;
117
+ type: z.ZodLiteral<"session_end">;
118
+ payload: z.ZodObject<{
119
+ eventId: z.ZodString;
120
+ seq: z.ZodNumber;
121
+ observedAt: z.ZodString;
122
+ sentAt: z.ZodString;
123
+ reason: z.ZodOptional<z.ZodEnum<{
124
+ app_shutdown: "app_shutdown";
125
+ logout: "logout";
126
+ network_change: "network_change";
127
+ sleep: "sleep";
128
+ unknown: "unknown";
129
+ }>>;
130
+ }, z.core.$strip>;
131
+ }, z.core.$strip>;
132
+ export declare const DeviceMediaConnectionHelloFrameSchema: z.ZodObject<{
133
+ protocol: z.ZodLiteral<"device.media.connection.v1">;
134
+ type: z.ZodLiteral<"hello">;
135
+ payload: z.ZodObject<{
136
+ capabilities: z.ZodObject<{
137
+ media: z.ZodBoolean;
138
+ localPlayback: z.ZodBoolean;
139
+ remotePlayback: z.ZodBoolean;
140
+ binaryAudio: z.ZodOptional<z.ZodBoolean>;
141
+ localRingBuffer: z.ZodOptional<z.ZodBoolean>;
142
+ localRingBufferSeconds: z.ZodOptional<z.ZodNumber>;
143
+ }, z.core.$strip>;
144
+ audio: z.ZodObject<{
145
+ codecs: z.ZodArray<z.ZodEnum<{
146
+ aac: "aac";
147
+ mp3: "mp3";
148
+ opus: "opus";
149
+ "pcm16-wav": "pcm16-wav";
150
+ }>>;
151
+ chunkDurationMs: z.ZodOptional<z.ZodNumber>;
152
+ }, z.core.$strip>;
153
+ supportedProtocols: z.ZodArray<z.ZodString>;
154
+ }, z.core.$strip>;
155
+ }, z.core.$strip>;
156
+ export declare const DeviceMediaConnectionHelloAckFrameSchema: z.ZodObject<{
157
+ protocol: z.ZodLiteral<"device.media.connection.v1">;
158
+ type: z.ZodLiteral<"hello_ack">;
159
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
160
+ accepted: z.ZodLiteral<true>;
161
+ serverTime: z.ZodString;
162
+ connectionId: z.ZodString;
163
+ selectedProtocols: z.ZodArray<z.ZodString>;
164
+ capabilities: z.ZodObject<{
165
+ streaming: z.ZodBoolean;
166
+ }, z.core.$strip>;
167
+ }, z.core.$strip>, z.ZodObject<{
168
+ accepted: z.ZodLiteral<false>;
169
+ serverTime: z.ZodString;
170
+ error: z.ZodObject<{
171
+ code: z.ZodString;
172
+ message: z.ZodString;
173
+ }, z.core.$strip>;
174
+ }, z.core.$strip>], "accepted">;
175
+ }, z.core.$strip>;
176
+ export declare const DeviceStreamStateSchema: z.ZodObject<{
177
+ permission: z.ZodEnum<{
178
+ allow: "allow";
179
+ disallow: "disallow";
180
+ }>;
181
+ playback: z.ZodEnum<{
182
+ paused: "paused";
183
+ playing: "playing";
184
+ }>;
185
+ capture: z.ZodEnum<{
186
+ capturing: "capturing";
187
+ "no-capture": "no-capture";
188
+ }>;
189
+ streamFormat: z.ZodOptional<z.ZodObject<{
190
+ codec: z.ZodEnum<{
191
+ aac: "aac";
192
+ mp3: "mp3";
193
+ opus: "opus";
194
+ "pcm16-wav": "pcm16-wav";
195
+ }>;
196
+ sampleRate: z.ZodNumber;
197
+ channels: z.ZodNumber;
198
+ bitDepth: z.ZodOptional<z.ZodNumber>;
199
+ }, z.core.$strip>>;
200
+ reason: z.ZodOptional<z.ZodEnum<{
201
+ capture_permission_missing: "capture_permission_missing";
202
+ capture_permission_revoked: "capture_permission_revoked";
203
+ capture_source_lost: "capture_source_lost";
204
+ capture_source_unavailable: "capture_source_unavailable";
205
+ native_error: "native_error";
206
+ no_playable_media: "no_playable_media";
207
+ unsupported_app: "unsupported_app";
208
+ }>>;
209
+ message: z.ZodOptional<z.ZodString>;
210
+ }, z.core.$strip>;
211
+ export declare const DeviceStreamStateUpdatedFrameSchema: z.ZodObject<{
212
+ protocol: z.ZodLiteral<"device.media.v1">;
213
+ type: z.ZodLiteral<"stream.state.updated">;
214
+ payload: z.ZodObject<{
215
+ sentAt: z.ZodString;
216
+ state: z.ZodObject<{
217
+ permission: z.ZodEnum<{
218
+ allow: "allow";
219
+ disallow: "disallow";
220
+ }>;
221
+ playback: z.ZodEnum<{
222
+ paused: "paused";
223
+ playing: "playing";
224
+ }>;
225
+ capture: z.ZodEnum<{
226
+ capturing: "capturing";
227
+ "no-capture": "no-capture";
228
+ }>;
229
+ streamFormat: z.ZodOptional<z.ZodObject<{
230
+ codec: z.ZodEnum<{
231
+ aac: "aac";
232
+ mp3: "mp3";
233
+ opus: "opus";
234
+ "pcm16-wav": "pcm16-wav";
235
+ }>;
236
+ sampleRate: z.ZodNumber;
237
+ channels: z.ZodNumber;
238
+ bitDepth: z.ZodOptional<z.ZodNumber>;
239
+ }, z.core.$strip>>;
240
+ reason: z.ZodOptional<z.ZodEnum<{
241
+ capture_permission_missing: "capture_permission_missing";
242
+ capture_permission_revoked: "capture_permission_revoked";
243
+ capture_source_lost: "capture_source_lost";
244
+ capture_source_unavailable: "capture_source_unavailable";
245
+ native_error: "native_error";
246
+ no_playable_media: "no_playable_media";
247
+ unsupported_app: "unsupported_app";
248
+ }>>;
249
+ message: z.ZodOptional<z.ZodString>;
250
+ }, z.core.$strip>;
251
+ }, z.core.$strip>;
252
+ }, z.core.$strip>;
253
+ export declare const DeviceMediaUpdatedFrameSchema: z.ZodObject<{
254
+ protocol: z.ZodLiteral<"device.media.v1">;
255
+ type: z.ZodLiteral<"media.updated">;
256
+ payload: z.ZodObject<{
257
+ sentAt: z.ZodString;
258
+ media: z.ZodObject<{
259
+ provider: z.ZodOptional<z.ZodString>;
260
+ providerId: z.ZodOptional<z.ZodString>;
261
+ source: z.ZodOptional<z.ZodString>;
262
+ itemType: z.ZodOptional<z.ZodString>;
263
+ id: z.ZodOptional<z.ZodString>;
264
+ trackId: z.ZodOptional<z.ZodString>;
265
+ title: z.ZodOptional<z.ZodString>;
266
+ artist: z.ZodOptional<z.ZodString>;
267
+ album: z.ZodOptional<z.ZodString>;
268
+ albumArtist: z.ZodOptional<z.ZodString>;
269
+ artworkUrl: z.ZodOptional<z.ZodString>;
270
+ linkUrl: z.ZodOptional<z.ZodString>;
271
+ progressSeconds: z.ZodOptional<z.ZodNumber>;
272
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
273
+ playbackState: z.ZodOptional<z.ZodEnum<{
274
+ paused: "paused";
275
+ playing: "playing";
276
+ }>>;
277
+ trackNumber: z.ZodOptional<z.ZodNumber>;
278
+ discNumber: z.ZodOptional<z.ZodNumber>;
279
+ collectionId: z.ZodOptional<z.ZodString>;
280
+ collectionTitle: z.ZodOptional<z.ZodString>;
281
+ collectionLinkUrl: z.ZodOptional<z.ZodString>;
282
+ }, z.core.$strip>;
283
+ clock: z.ZodOptional<z.ZodObject<{
284
+ mediaProgressSeconds: z.ZodOptional<z.ZodNumber>;
285
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
286
+ updatedAt: z.ZodOptional<z.ZodString>;
287
+ }, z.core.$strip>>;
288
+ }, z.core.$strip>;
289
+ }, z.core.$strip>;
290
+ export declare const DeviceMediaCommandFrameSchema: z.ZodObject<{
291
+ protocol: z.ZodLiteral<"device.media.v1">;
292
+ type: z.ZodLiteral<"command">;
293
+ payload: z.ZodObject<{
294
+ commandId: z.ZodString;
295
+ sentAt: z.ZodString;
296
+ expiresAt: z.ZodString;
297
+ command: z.ZodDiscriminatedUnion<[z.ZodObject<{
298
+ type: z.ZodLiteral<"stream.requested">;
299
+ streamId: z.ZodString;
300
+ generation: z.ZodNumber;
301
+ }, z.core.$strip>, z.ZodObject<{
302
+ type: z.ZodLiteral<"stream.resume">;
303
+ streamId: z.ZodString;
304
+ generation: z.ZodNumber;
305
+ fromSeq: z.ZodNumber;
306
+ }, z.core.$strip>, z.ZodObject<{
307
+ type: z.ZodLiteral<"stream.stop">;
308
+ reason: z.ZodString;
309
+ }, z.core.$strip>], "type">;
310
+ }, z.core.$strip>;
311
+ }, z.core.$strip>;
312
+ export declare const DeviceMediaCommandAckFrameSchema: z.ZodObject<{
313
+ protocol: z.ZodLiteral<"device.media.v1">;
314
+ type: z.ZodLiteral<"ack">;
315
+ payload: z.ZodUnion<readonly [z.ZodObject<{
316
+ commandId: z.ZodString;
317
+ commandType: z.ZodLiteral<"stream.requested">;
318
+ status: z.ZodLiteral<"accepted">;
319
+ streamId: z.ZodString;
320
+ generation: z.ZodNumber;
321
+ firstSeq: z.ZodNumber;
322
+ capture: z.ZodOptional<z.ZodObject<{
323
+ provider: z.ZodOptional<z.ZodString>;
324
+ displayName: z.ZodOptional<z.ZodString>;
325
+ appId: z.ZodOptional<z.ZodString>;
326
+ }, z.core.$strip>>;
327
+ streamFormat: z.ZodObject<{
328
+ codec: z.ZodEnum<{
329
+ aac: "aac";
330
+ mp3: "mp3";
331
+ opus: "opus";
332
+ "pcm16-wav": "pcm16-wav";
333
+ }>;
334
+ sampleRate: z.ZodNumber;
335
+ channels: z.ZodNumber;
336
+ bitDepth: z.ZodOptional<z.ZodNumber>;
337
+ }, z.core.$strip>;
338
+ sentAt: z.ZodString;
339
+ }, z.core.$strip>, z.ZodObject<{
340
+ commandId: z.ZodString;
341
+ commandType: z.ZodLiteral<"stream.resume">;
342
+ status: z.ZodLiteral<"accepted">;
343
+ streamId: z.ZodString;
344
+ generation: z.ZodNumber;
345
+ firstSeq: z.ZodNumber;
346
+ unavailableBeforeSeq: z.ZodOptional<z.ZodNumber>;
347
+ capture: z.ZodOptional<z.ZodObject<{
348
+ provider: z.ZodOptional<z.ZodString>;
349
+ displayName: z.ZodOptional<z.ZodString>;
350
+ appId: z.ZodOptional<z.ZodString>;
351
+ }, z.core.$strip>>;
352
+ streamFormat: z.ZodOptional<z.ZodObject<{
353
+ codec: z.ZodEnum<{
354
+ aac: "aac";
355
+ mp3: "mp3";
356
+ opus: "opus";
357
+ "pcm16-wav": "pcm16-wav";
358
+ }>;
359
+ sampleRate: z.ZodNumber;
360
+ channels: z.ZodNumber;
361
+ bitDepth: z.ZodOptional<z.ZodNumber>;
362
+ }, z.core.$strip>>;
363
+ sentAt: z.ZodString;
364
+ }, z.core.$strip>, z.ZodObject<{
365
+ commandId: z.ZodString;
366
+ commandType: z.ZodEnum<{
367
+ "stream.requested": "stream.requested";
368
+ "stream.resume": "stream.resume";
369
+ }>;
370
+ status: z.ZodLiteral<"rejected">;
371
+ rejectedReason: z.ZodEnum<{
372
+ capture_permission_missing: "capture_permission_missing";
373
+ capture_permission_revoked: "capture_permission_revoked";
374
+ capture_source_lost: "capture_source_lost";
375
+ capture_source_unavailable: "capture_source_unavailable";
376
+ native_error: "native_error";
377
+ no_playable_media: "no_playable_media";
378
+ unsupported_app: "unsupported_app";
379
+ }>;
380
+ sentAt: z.ZodString;
381
+ }, z.core.$strip>, z.ZodObject<{
382
+ commandId: z.ZodString;
383
+ commandType: z.ZodLiteral<"stream.stop">;
384
+ status: z.ZodLiteral<"stopped">;
385
+ streamId: z.ZodString;
386
+ generation: z.ZodNumber;
387
+ sentAt: z.ZodString;
388
+ }, z.core.$strip>]>;
389
+ }, z.core.$strip>;
390
+ export declare const DeviceMediaAudioChunkFrameSchema: z.ZodObject<{
391
+ protocol: z.ZodLiteral<"device.media.v1">;
392
+ type: z.ZodLiteral<"audio.chunk">;
393
+ payload: z.ZodObject<{
394
+ streamId: z.ZodString;
395
+ generation: z.ZodNumber;
396
+ seq: z.ZodNumber;
397
+ sentAt: z.ZodString;
398
+ durationMs: z.ZodNumber;
399
+ byteLength: z.ZodNumber;
400
+ clock: z.ZodOptional<z.ZodObject<{
401
+ mediaProgressSeconds: z.ZodOptional<z.ZodNumber>;
402
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
403
+ updatedAt: z.ZodOptional<z.ZodString>;
404
+ }, z.core.$strip>>;
405
+ }, z.core.$strip>;
406
+ }, z.core.$strip>;
407
+ export declare const DeviceMediaStreamHeartbeatFrameSchema: z.ZodObject<{
408
+ protocol: z.ZodLiteral<"device.media.v1">;
409
+ type: z.ZodLiteral<"stream.heartbeat">;
410
+ payload: z.ZodObject<{
411
+ streamId: z.ZodString;
412
+ generation: z.ZodNumber;
413
+ sentAt: z.ZodString;
414
+ lastSeq: z.ZodNumber;
415
+ clock: z.ZodOptional<z.ZodObject<{
416
+ mediaProgressSeconds: z.ZodOptional<z.ZodNumber>;
417
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
418
+ updatedAt: z.ZodOptional<z.ZodString>;
419
+ }, z.core.$strip>>;
420
+ capture: z.ZodOptional<z.ZodObject<{
421
+ provider: z.ZodOptional<z.ZodString>;
422
+ displayName: z.ZodOptional<z.ZodString>;
423
+ appId: z.ZodOptional<z.ZodString>;
424
+ }, z.core.$strip>>;
425
+ }, z.core.$strip>;
426
+ }, z.core.$strip>;
427
+ export declare const DeviceMediaStreamStoppedFrameSchema: z.ZodObject<{
428
+ protocol: z.ZodLiteral<"device.media.v1">;
429
+ type: z.ZodLiteral<"stream.stopped">;
430
+ payload: z.ZodObject<{
431
+ streamId: z.ZodString;
432
+ generation: z.ZodNumber;
433
+ reason: z.ZodUnion<readonly [z.ZodEnum<{
434
+ capture_permission_missing: "capture_permission_missing";
435
+ capture_permission_revoked: "capture_permission_revoked";
436
+ capture_source_lost: "capture_source_lost";
437
+ capture_source_unavailable: "capture_source_unavailable";
438
+ native_error: "native_error";
439
+ no_playable_media: "no_playable_media";
440
+ unsupported_app: "unsupported_app";
441
+ }>, z.ZodEnum<{
442
+ manual_stop: "manual_stop";
443
+ native_shutdown: "native_shutdown";
444
+ }>]>;
445
+ sentAt: z.ZodString;
446
+ }, z.core.$strip>;
447
+ }, z.core.$strip>;
448
+ export declare const DeviceMediaErrorFrameSchema: z.ZodObject<{
449
+ protocol: z.ZodLiteral<"device.media.v1">;
450
+ type: z.ZodLiteral<"error">;
451
+ payload: z.ZodObject<{
452
+ sentAt: z.ZodString;
453
+ error: z.ZodObject<{
454
+ code: z.ZodString;
455
+ message: z.ZodString;
456
+ }, z.core.$strip>;
457
+ }, z.core.$strip>;
458
+ }, z.core.$strip>;
459
+ export declare const DeviceCommonClientFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
460
+ protocol: z.ZodLiteral<"device.connection.v1">;
461
+ type: z.ZodLiteral<"hello">;
462
+ payload: z.ZodObject<{
463
+ device: z.ZodObject<{
464
+ name: z.ZodString;
465
+ platform: z.ZodEnum<{
466
+ linux: "linux";
467
+ macos: "macos";
468
+ other: "other";
469
+ windows: "windows";
470
+ }>;
471
+ appVersion: z.ZodOptional<z.ZodString>;
472
+ mode: z.ZodOptional<z.ZodString>;
473
+ displayName: z.ZodOptional<z.ZodString>;
474
+ }, z.core.$strip>;
475
+ capabilities: z.ZodObject<{
476
+ focusApp: z.ZodBoolean;
477
+ windowTitle: z.ZodBoolean;
478
+ pageTitle: z.ZodBoolean;
479
+ pageUrl: z.ZodBoolean;
480
+ }, z.core.$strip>;
481
+ supportedProtocols: z.ZodArray<z.ZodString>;
482
+ }, z.core.$strip>;
483
+ }, z.core.$strip>, z.ZodObject<{
484
+ protocol: z.ZodLiteral<"presence.v2">;
485
+ type: z.ZodLiteral<"snapshot">;
486
+ payload: z.ZodObject<{
487
+ eventId: z.ZodString;
488
+ seq: z.ZodNumber;
489
+ observedAt: z.ZodString;
490
+ sentAt: z.ZodString;
491
+ state: z.ZodObject<{
492
+ availability: z.ZodObject<{
493
+ state: z.ZodEnum<{
494
+ active: "active";
495
+ idle: "idle";
496
+ }>;
497
+ idleSeconds: z.ZodOptional<z.ZodNumber>;
498
+ }, z.core.$strip>;
499
+ focus: z.ZodObject<{
500
+ app: z.ZodOptional<z.ZodObject<{
501
+ name: z.ZodOptional<z.ZodString>;
502
+ id: z.ZodOptional<z.ZodString>;
503
+ category: z.ZodOptional<z.ZodString>;
504
+ window: z.ZodOptional<z.ZodObject<{
505
+ title: z.ZodOptional<z.ZodString>;
506
+ }, z.core.$strip>>;
507
+ page: z.ZodOptional<z.ZodObject<{
508
+ title: z.ZodOptional<z.ZodString>;
509
+ url: z.ZodOptional<z.ZodString>;
510
+ }, z.core.$strip>>;
511
+ }, z.core.$strip>>;
512
+ }, z.core.$strip>;
513
+ }, z.core.$strip>;
514
+ }, z.core.$strip>;
515
+ }, z.core.$strip>, z.ZodObject<{
516
+ protocol: z.ZodLiteral<"presence.v2">;
517
+ type: z.ZodLiteral<"heartbeat">;
518
+ payload: z.ZodObject<{
519
+ eventId: z.ZodString;
520
+ seq: z.ZodNumber;
521
+ observedAt: z.ZodString;
522
+ sentAt: z.ZodString;
523
+ }, z.core.$strip>;
524
+ }, z.core.$strip>, z.ZodObject<{
525
+ protocol: z.ZodLiteral<"presence.v2">;
526
+ type: z.ZodLiteral<"session_end">;
527
+ payload: z.ZodObject<{
528
+ eventId: z.ZodString;
529
+ seq: z.ZodNumber;
530
+ observedAt: z.ZodString;
531
+ sentAt: z.ZodString;
532
+ reason: z.ZodOptional<z.ZodEnum<{
533
+ app_shutdown: "app_shutdown";
534
+ logout: "logout";
535
+ network_change: "network_change";
536
+ sleep: "sleep";
537
+ unknown: "unknown";
538
+ }>>;
539
+ }, z.core.$strip>;
540
+ }, z.core.$strip>], "type">;
541
+ export declare const DeviceCommonServerFrameSchema: z.ZodObject<{
542
+ protocol: z.ZodLiteral<"device.connection.v1">;
543
+ type: z.ZodLiteral<"hello_ack">;
544
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
545
+ accepted: z.ZodLiteral<true>;
546
+ serverTime: z.ZodString;
547
+ connectionId: z.ZodString;
548
+ deviceSessionId: z.ZodString;
549
+ selectedProtocols: z.ZodArray<z.ZodString>;
550
+ }, z.core.$strip>, z.ZodObject<{
551
+ accepted: z.ZodLiteral<false>;
552
+ serverTime: z.ZodString;
553
+ error: z.ZodObject<{
554
+ code: z.ZodString;
555
+ message: z.ZodString;
556
+ }, z.core.$strip>;
557
+ }, z.core.$strip>], "accepted">;
558
+ }, z.core.$strip>;
559
+ export declare const DeviceMediaClientFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
560
+ protocol: z.ZodLiteral<"device.media.connection.v1">;
561
+ type: z.ZodLiteral<"hello">;
562
+ payload: z.ZodObject<{
563
+ capabilities: z.ZodObject<{
564
+ media: z.ZodBoolean;
565
+ localPlayback: z.ZodBoolean;
566
+ remotePlayback: z.ZodBoolean;
567
+ binaryAudio: z.ZodOptional<z.ZodBoolean>;
568
+ localRingBuffer: z.ZodOptional<z.ZodBoolean>;
569
+ localRingBufferSeconds: z.ZodOptional<z.ZodNumber>;
570
+ }, z.core.$strip>;
571
+ audio: z.ZodObject<{
572
+ codecs: z.ZodArray<z.ZodEnum<{
573
+ aac: "aac";
574
+ mp3: "mp3";
575
+ opus: "opus";
576
+ "pcm16-wav": "pcm16-wav";
577
+ }>>;
578
+ chunkDurationMs: z.ZodOptional<z.ZodNumber>;
579
+ }, z.core.$strip>;
580
+ supportedProtocols: z.ZodArray<z.ZodString>;
581
+ }, z.core.$strip>;
582
+ }, z.core.$strip>, z.ZodObject<{
583
+ protocol: z.ZodLiteral<"device.media.v1">;
584
+ type: z.ZodLiteral<"stream.state.updated">;
585
+ payload: z.ZodObject<{
586
+ sentAt: z.ZodString;
587
+ state: z.ZodObject<{
588
+ permission: z.ZodEnum<{
589
+ allow: "allow";
590
+ disallow: "disallow";
591
+ }>;
592
+ playback: z.ZodEnum<{
593
+ paused: "paused";
594
+ playing: "playing";
595
+ }>;
596
+ capture: z.ZodEnum<{
597
+ capturing: "capturing";
598
+ "no-capture": "no-capture";
599
+ }>;
600
+ streamFormat: z.ZodOptional<z.ZodObject<{
601
+ codec: z.ZodEnum<{
602
+ aac: "aac";
603
+ mp3: "mp3";
604
+ opus: "opus";
605
+ "pcm16-wav": "pcm16-wav";
606
+ }>;
607
+ sampleRate: z.ZodNumber;
608
+ channels: z.ZodNumber;
609
+ bitDepth: z.ZodOptional<z.ZodNumber>;
610
+ }, z.core.$strip>>;
611
+ reason: z.ZodOptional<z.ZodEnum<{
612
+ capture_permission_missing: "capture_permission_missing";
613
+ capture_permission_revoked: "capture_permission_revoked";
614
+ capture_source_lost: "capture_source_lost";
615
+ capture_source_unavailable: "capture_source_unavailable";
616
+ native_error: "native_error";
617
+ no_playable_media: "no_playable_media";
618
+ unsupported_app: "unsupported_app";
619
+ }>>;
620
+ message: z.ZodOptional<z.ZodString>;
621
+ }, z.core.$strip>;
622
+ }, z.core.$strip>;
623
+ }, z.core.$strip>, z.ZodObject<{
624
+ protocol: z.ZodLiteral<"device.media.v1">;
625
+ type: z.ZodLiteral<"media.updated">;
626
+ payload: z.ZodObject<{
627
+ sentAt: z.ZodString;
628
+ media: z.ZodObject<{
629
+ provider: z.ZodOptional<z.ZodString>;
630
+ providerId: z.ZodOptional<z.ZodString>;
631
+ source: z.ZodOptional<z.ZodString>;
632
+ itemType: z.ZodOptional<z.ZodString>;
633
+ id: z.ZodOptional<z.ZodString>;
634
+ trackId: z.ZodOptional<z.ZodString>;
635
+ title: z.ZodOptional<z.ZodString>;
636
+ artist: z.ZodOptional<z.ZodString>;
637
+ album: z.ZodOptional<z.ZodString>;
638
+ albumArtist: z.ZodOptional<z.ZodString>;
639
+ artworkUrl: z.ZodOptional<z.ZodString>;
640
+ linkUrl: z.ZodOptional<z.ZodString>;
641
+ progressSeconds: z.ZodOptional<z.ZodNumber>;
642
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
643
+ playbackState: z.ZodOptional<z.ZodEnum<{
644
+ paused: "paused";
645
+ playing: "playing";
646
+ }>>;
647
+ trackNumber: z.ZodOptional<z.ZodNumber>;
648
+ discNumber: z.ZodOptional<z.ZodNumber>;
649
+ collectionId: z.ZodOptional<z.ZodString>;
650
+ collectionTitle: z.ZodOptional<z.ZodString>;
651
+ collectionLinkUrl: z.ZodOptional<z.ZodString>;
652
+ }, z.core.$strip>;
653
+ clock: z.ZodOptional<z.ZodObject<{
654
+ mediaProgressSeconds: z.ZodOptional<z.ZodNumber>;
655
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
656
+ updatedAt: z.ZodOptional<z.ZodString>;
657
+ }, z.core.$strip>>;
658
+ }, z.core.$strip>;
659
+ }, z.core.$strip>, z.ZodObject<{
660
+ protocol: z.ZodLiteral<"device.media.v1">;
661
+ type: z.ZodLiteral<"ack">;
662
+ payload: z.ZodUnion<readonly [z.ZodObject<{
663
+ commandId: z.ZodString;
664
+ commandType: z.ZodLiteral<"stream.requested">;
665
+ status: z.ZodLiteral<"accepted">;
666
+ streamId: z.ZodString;
667
+ generation: z.ZodNumber;
668
+ firstSeq: z.ZodNumber;
669
+ capture: z.ZodOptional<z.ZodObject<{
670
+ provider: z.ZodOptional<z.ZodString>;
671
+ displayName: z.ZodOptional<z.ZodString>;
672
+ appId: z.ZodOptional<z.ZodString>;
673
+ }, z.core.$strip>>;
674
+ streamFormat: z.ZodObject<{
675
+ codec: z.ZodEnum<{
676
+ aac: "aac";
677
+ mp3: "mp3";
678
+ opus: "opus";
679
+ "pcm16-wav": "pcm16-wav";
680
+ }>;
681
+ sampleRate: z.ZodNumber;
682
+ channels: z.ZodNumber;
683
+ bitDepth: z.ZodOptional<z.ZodNumber>;
684
+ }, z.core.$strip>;
685
+ sentAt: z.ZodString;
686
+ }, z.core.$strip>, z.ZodObject<{
687
+ commandId: z.ZodString;
688
+ commandType: z.ZodLiteral<"stream.resume">;
689
+ status: z.ZodLiteral<"accepted">;
690
+ streamId: z.ZodString;
691
+ generation: z.ZodNumber;
692
+ firstSeq: z.ZodNumber;
693
+ unavailableBeforeSeq: z.ZodOptional<z.ZodNumber>;
694
+ capture: z.ZodOptional<z.ZodObject<{
695
+ provider: z.ZodOptional<z.ZodString>;
696
+ displayName: z.ZodOptional<z.ZodString>;
697
+ appId: z.ZodOptional<z.ZodString>;
698
+ }, z.core.$strip>>;
699
+ streamFormat: z.ZodOptional<z.ZodObject<{
700
+ codec: z.ZodEnum<{
701
+ aac: "aac";
702
+ mp3: "mp3";
703
+ opus: "opus";
704
+ "pcm16-wav": "pcm16-wav";
705
+ }>;
706
+ sampleRate: z.ZodNumber;
707
+ channels: z.ZodNumber;
708
+ bitDepth: z.ZodOptional<z.ZodNumber>;
709
+ }, z.core.$strip>>;
710
+ sentAt: z.ZodString;
711
+ }, z.core.$strip>, z.ZodObject<{
712
+ commandId: z.ZodString;
713
+ commandType: z.ZodEnum<{
714
+ "stream.requested": "stream.requested";
715
+ "stream.resume": "stream.resume";
716
+ }>;
717
+ status: z.ZodLiteral<"rejected">;
718
+ rejectedReason: z.ZodEnum<{
719
+ capture_permission_missing: "capture_permission_missing";
720
+ capture_permission_revoked: "capture_permission_revoked";
721
+ capture_source_lost: "capture_source_lost";
722
+ capture_source_unavailable: "capture_source_unavailable";
723
+ native_error: "native_error";
724
+ no_playable_media: "no_playable_media";
725
+ unsupported_app: "unsupported_app";
726
+ }>;
727
+ sentAt: z.ZodString;
728
+ }, z.core.$strip>, z.ZodObject<{
729
+ commandId: z.ZodString;
730
+ commandType: z.ZodLiteral<"stream.stop">;
731
+ status: z.ZodLiteral<"stopped">;
732
+ streamId: z.ZodString;
733
+ generation: z.ZodNumber;
734
+ sentAt: z.ZodString;
735
+ }, z.core.$strip>]>;
736
+ }, z.core.$strip>, z.ZodObject<{
737
+ protocol: z.ZodLiteral<"device.media.v1">;
738
+ type: z.ZodLiteral<"audio.chunk">;
739
+ payload: z.ZodObject<{
740
+ streamId: z.ZodString;
741
+ generation: z.ZodNumber;
742
+ seq: z.ZodNumber;
743
+ sentAt: z.ZodString;
744
+ durationMs: z.ZodNumber;
745
+ byteLength: z.ZodNumber;
746
+ clock: z.ZodOptional<z.ZodObject<{
747
+ mediaProgressSeconds: z.ZodOptional<z.ZodNumber>;
748
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
749
+ updatedAt: z.ZodOptional<z.ZodString>;
750
+ }, z.core.$strip>>;
751
+ }, z.core.$strip>;
752
+ }, z.core.$strip>, z.ZodObject<{
753
+ protocol: z.ZodLiteral<"device.media.v1">;
754
+ type: z.ZodLiteral<"stream.heartbeat">;
755
+ payload: z.ZodObject<{
756
+ streamId: z.ZodString;
757
+ generation: z.ZodNumber;
758
+ sentAt: z.ZodString;
759
+ lastSeq: z.ZodNumber;
760
+ clock: z.ZodOptional<z.ZodObject<{
761
+ mediaProgressSeconds: z.ZodOptional<z.ZodNumber>;
762
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
763
+ updatedAt: z.ZodOptional<z.ZodString>;
764
+ }, z.core.$strip>>;
765
+ capture: z.ZodOptional<z.ZodObject<{
766
+ provider: z.ZodOptional<z.ZodString>;
767
+ displayName: z.ZodOptional<z.ZodString>;
768
+ appId: z.ZodOptional<z.ZodString>;
769
+ }, z.core.$strip>>;
770
+ }, z.core.$strip>;
771
+ }, z.core.$strip>, z.ZodObject<{
772
+ protocol: z.ZodLiteral<"device.media.v1">;
773
+ type: z.ZodLiteral<"stream.stopped">;
774
+ payload: z.ZodObject<{
775
+ streamId: z.ZodString;
776
+ generation: z.ZodNumber;
777
+ reason: z.ZodUnion<readonly [z.ZodEnum<{
778
+ capture_permission_missing: "capture_permission_missing";
779
+ capture_permission_revoked: "capture_permission_revoked";
780
+ capture_source_lost: "capture_source_lost";
781
+ capture_source_unavailable: "capture_source_unavailable";
782
+ native_error: "native_error";
783
+ no_playable_media: "no_playable_media";
784
+ unsupported_app: "unsupported_app";
785
+ }>, z.ZodEnum<{
786
+ manual_stop: "manual_stop";
787
+ native_shutdown: "native_shutdown";
788
+ }>]>;
789
+ sentAt: z.ZodString;
790
+ }, z.core.$strip>;
791
+ }, z.core.$strip>, z.ZodObject<{
792
+ protocol: z.ZodLiteral<"device.media.v1">;
793
+ type: z.ZodLiteral<"error">;
794
+ payload: z.ZodObject<{
795
+ sentAt: z.ZodString;
796
+ error: z.ZodObject<{
797
+ code: z.ZodString;
798
+ message: z.ZodString;
799
+ }, z.core.$strip>;
800
+ }, z.core.$strip>;
801
+ }, z.core.$strip>], "type">;
802
+ export declare const DeviceMediaServerFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
803
+ protocol: z.ZodLiteral<"device.media.connection.v1">;
804
+ type: z.ZodLiteral<"hello_ack">;
805
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
806
+ accepted: z.ZodLiteral<true>;
807
+ serverTime: z.ZodString;
808
+ connectionId: z.ZodString;
809
+ selectedProtocols: z.ZodArray<z.ZodString>;
810
+ capabilities: z.ZodObject<{
811
+ streaming: z.ZodBoolean;
812
+ }, z.core.$strip>;
813
+ }, z.core.$strip>, z.ZodObject<{
814
+ accepted: z.ZodLiteral<false>;
815
+ serverTime: z.ZodString;
816
+ error: z.ZodObject<{
817
+ code: z.ZodString;
818
+ message: z.ZodString;
819
+ }, z.core.$strip>;
820
+ }, z.core.$strip>], "accepted">;
821
+ }, z.core.$strip>, z.ZodObject<{
822
+ protocol: z.ZodLiteral<"device.media.v1">;
823
+ type: z.ZodLiteral<"command">;
824
+ payload: z.ZodObject<{
825
+ commandId: z.ZodString;
826
+ sentAt: z.ZodString;
827
+ expiresAt: z.ZodString;
828
+ command: z.ZodDiscriminatedUnion<[z.ZodObject<{
829
+ type: z.ZodLiteral<"stream.requested">;
830
+ streamId: z.ZodString;
831
+ generation: z.ZodNumber;
832
+ }, z.core.$strip>, z.ZodObject<{
833
+ type: z.ZodLiteral<"stream.resume">;
834
+ streamId: z.ZodString;
835
+ generation: z.ZodNumber;
836
+ fromSeq: z.ZodNumber;
837
+ }, z.core.$strip>, z.ZodObject<{
838
+ type: z.ZodLiteral<"stream.stop">;
839
+ reason: z.ZodString;
840
+ }, z.core.$strip>], "type">;
841
+ }, z.core.$strip>;
842
+ }, z.core.$strip>], "type">;
843
+ export type DeviceCommonConnectionHelloFrame = z.infer<typeof DeviceCommonConnectionHelloFrameSchema>;
844
+ export type DeviceCommonConnectionHelloAckFrame = z.infer<typeof DeviceCommonConnectionHelloAckFrameSchema>;
845
+ export type CommonPresenceState = z.infer<typeof CommonPresenceStateSchema>;
846
+ export type PresenceSnapshotFrame = z.infer<typeof PresenceSnapshotFrameSchema>;
847
+ export type PresenceHeartbeatFrame = z.infer<typeof PresenceHeartbeatFrameSchema>;
848
+ export type PresenceSessionEndFrame = z.infer<typeof PresenceSessionEndFrameSchema>;
849
+ export type DeviceMediaConnectionHelloFrame = z.infer<typeof DeviceMediaConnectionHelloFrameSchema>;
850
+ export type DeviceMediaConnectionHelloAckFrame = z.infer<typeof DeviceMediaConnectionHelloAckFrameSchema>;
851
+ export type DeviceStreamState = z.infer<typeof DeviceStreamStateSchema>;
852
+ export type DeviceStreamStateUpdatedFrame = z.infer<typeof DeviceStreamStateUpdatedFrameSchema>;
853
+ export type DeviceMediaUpdatedFrame = z.infer<typeof DeviceMediaUpdatedFrameSchema>;
854
+ export type DeviceMediaCommandFrame = z.infer<typeof DeviceMediaCommandFrameSchema>;
855
+ export type DeviceMediaCommandAckFrame = z.infer<typeof DeviceMediaCommandAckFrameSchema>;
856
+ export type DeviceMediaAudioChunkFrame = z.infer<typeof DeviceMediaAudioChunkFrameSchema>;
857
+ export type DeviceMediaStreamHeartbeatFrame = z.infer<typeof DeviceMediaStreamHeartbeatFrameSchema>;
858
+ export type DeviceMediaStreamStoppedFrame = z.infer<typeof DeviceMediaStreamStoppedFrameSchema>;
859
+ export type DeviceMediaErrorFrame = z.infer<typeof DeviceMediaErrorFrameSchema>;
860
+ export type DeviceCommonClientFrame = z.infer<typeof DeviceCommonClientFrameSchema>;
861
+ export type DeviceCommonServerFrame = z.infer<typeof DeviceCommonServerFrameSchema>;
862
+ export type DeviceMediaClientFrame = z.infer<typeof DeviceMediaClientFrameSchema>;
863
+ export type DeviceMediaServerFrame = z.infer<typeof DeviceMediaServerFrameSchema>;
864
+ //# sourceMappingURL=device.d.ts.map