@urun-sh/core 0.2.17 → 0.2.18

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.
@@ -1,10 +1,46 @@
1
- import { b as AppOptions, a as App$1, N as SessionPhase, U as SessionStatus, Q as SessionPhaseName, A as AccessTokenOptions$1, y as RuntimeArtifact, z as RuntimeArtifactDownload, R as Recording, G as Session$1, C as ChannelEndpoint, $ as TransportSession, c as AttachOptions, v as RecordingsAccessor, B as RuntimeArtifactsAccessor, J as SessionEndResult, V as SessionStream$1, _ as StreamDataTransport, I as SessionDocumentImpl, Z as StreamChunkOptions, g as ChunkReadable, P as Presence, k as DocConnector, w as RequestOptions, x as RequestStreamOptions, Y as StoreOptions, X as Store, e as ChannelMultiplexer, K as SessionFailureKind, a1 as TransportState } from './stream-data-rqyqR75F.mjs';
2
- export { L as Layer, l as LayoutConfig, m as LayoutContext, M as MediaChunkBinding, o as MediaChunkSource, p as MediaChunkSourceFactory, q as MediaRecorderChunkSourceOptions, r as PresenceState, s as RecordingBucket, t as RecordingLifecycle, u as RecordingStatus, E as RuntimeAvailability, S as SceneContext, F as SceneGraph, H as SessionDocument, O as SessionPhaseError, W as SessionText, a5 as isPendingRecording, a6 as mediaRecorderChunkSource } from './stream-data-rqyqR75F.mjs';
1
+ import { d as AppOptions, c as App$1, Q as SessionPhase, W as SessionStatus, U as SessionPhaseName, A as AccessTokenOptions$1, B as RuntimeArtifact, E as RuntimeArtifactDownload, R as Recording, I as Session$1, C as ChannelEndpoint, a1 as TransportSession, e as AttachOptions, a as ActivationEvent, x as RecordingsAccessor, F as RuntimeArtifactsAccessor, N as SessionEndResult, X as SessionStream$1, a0 as StreamDataTransport, K as SessionDocumentImpl, $ as StreamChunkOptions, i as ChunkReadable, P as Presence, m as DocConnector, y as RequestOptions, z as RequestStreamOptions, _ as StoreOptions, Z as Store, g as ChannelMultiplexer, O as SessionFailureKind, a3 as TransportState } from './stream-data-ChMs2mq2.mjs';
2
+ export { b as ActivationState, L as Layer, n as LayoutConfig, o as LayoutContext, M as MediaChunkBinding, q as MediaChunkSource, r as MediaChunkSourceFactory, s as MediaRecorderChunkSourceOptions, t as PresenceState, u as RecordingBucket, v as RecordingLifecycle, w as RecordingStatus, G as RuntimeAvailability, S as SceneContext, H as SceneGraph, J as SessionDocument, T as SessionPhaseError, Y as SessionText, a7 as isPendingRecording, a8 as mediaRecorderChunkSource } from './stream-data-ChMs2mq2.mjs';
3
3
  import 'yjs';
4
4
  import 'y-protocols/awareness';
5
5
 
6
6
  declare function App(appId: string, options: AppOptions): App$1;
7
7
 
8
+ declare const DEFAULT_GATEWAY_URL = "https://api.urun.sh";
9
+ interface CreateClientTokenOptions {
10
+
11
+ baseUrl?: string;
12
+
13
+ expiresIn?: number;
14
+
15
+ allowedFunctions?: string[];
16
+
17
+ allowedOrigins?: string[];
18
+
19
+ maxSessionS?: number;
20
+
21
+ subject?: string;
22
+
23
+ metadata?: Record<string, unknown>;
24
+
25
+ fetch?: typeof fetch;
26
+ }
27
+
28
+ interface ClientToken {
29
+
30
+ token: string;
31
+
32
+ expiresAt: Date;
33
+
34
+ orgId: string;
35
+ }
36
+
37
+ declare class ClientTokenError extends Error {
38
+ readonly status?: number;
39
+ constructor(message: string, status?: number);
40
+ }
41
+
42
+ declare function createClientToken(apiKey: string, options?: CreateClientTokenOptions): Promise<ClientToken>;
43
+
8
44
  interface AccessTokenOptions {
9
45
  forceRefresh?: boolean;
10
46
  reason?: 'initial' | 'unauthorized' | 'background';
@@ -191,6 +227,8 @@ declare class SessionStream implements SessionStream$1 {
191
227
 
192
228
  private _onActivity?;
193
229
  private _track;
230
+
231
+ private _overrideTrack;
194
232
  private _handlers;
195
233
  private _unsubscribeTransport;
196
234
 
@@ -217,6 +255,8 @@ declare class SessionStream implements SessionStream$1 {
217
255
  private _deliver;
218
256
  get track(): MediaStreamTrack | null;
219
257
 
258
+ _setOverrideTrack(track: MediaStreamTrack | null): void;
259
+
220
260
  private _claimBrowserProducer;
221
261
  attach(track: MediaStreamTrack): Promise<void>;
222
262
 
@@ -255,6 +295,8 @@ declare class Session implements Session$1 {
255
295
 
256
296
  private _activity;
257
297
 
298
+ private _activation;
299
+
258
300
  private _activeRequests;
259
301
  private _endHandler?;
260
302
  private _endPromise?;
@@ -270,6 +312,10 @@ declare class Session implements Session$1 {
270
312
  private _recoveryHooks;
271
313
 
272
314
  private _lifecycleUnsub;
315
+
316
+ private _dialNegotiation;
317
+
318
+ private _dialNegotiationStarted;
273
319
  constructor(sessionId: string, multiplexer: ChannelEndpoint, transport: TransportSession, recordingsAuth?: RecordingsClientOptions, artifactsAuth?: RuntimeArtifactsClientOptions);
274
320
  private _wireControlDocIncarnation;
275
321
 
@@ -284,6 +330,8 @@ declare class Session implements Session$1 {
284
330
 
285
331
  onPhase(handler: (phase: SessionPhase) => void): () => void;
286
332
 
333
+ onActivation(handler: (event: ActivationEvent) => void): () => void;
334
+
287
335
  whenLive(options?: WhenLiveOptions): Promise<void>;
288
336
 
289
337
  get recordings(): RecordingsAccessor;
@@ -326,6 +374,12 @@ declare class Session implements Session$1 {
326
374
  recover(): void;
327
375
 
328
376
  onRecovery(hook: () => void): () => void;
377
+
378
+ negotiateMediaTransport(opts?: {
379
+ allowWebTransport?: boolean;
380
+ }): void;
381
+
382
+ get mediaTransport(): 'webtransport' | 'webrtc' | null;
329
383
  end(): Promise<SessionEndResult>;
330
384
  disconnect(): void;
331
385
  }
@@ -334,6 +388,70 @@ declare const FOREGROUND_COALESCE_MS = 250;
334
388
 
335
389
  declare function observePageLifecycle(onForeground: () => void): () => void;
336
390
 
391
+ declare const ACTIVATION_STILL_AFTER_MS = 15000;
392
+
393
+ declare const ACTIVATION_COLD_BOOT_AFTER_MS = 45000;
394
+
395
+ declare const ACTIVATION_DEGRADED_AFTER_MS = 120000;
396
+
397
+ declare const ACTIVATION_HINT_PATH = "desired.activation";
398
+
399
+ declare function activationHintFrom(value: unknown): string | undefined;
400
+
401
+ interface ActivationStreamLike {
402
+
403
+ readonly track: MediaStreamTrack | null;
404
+
405
+ on(event: 'track', handler: (track: MediaStreamTrack | null) => void): () => void;
406
+ }
407
+
408
+ interface ActivationMonitorOptions {
409
+
410
+ onPhase(handler: (phase: SessionPhase) => void): () => void;
411
+
412
+ hint(): unknown;
413
+
414
+ onData?(name: string, handler: (payload: unknown) => void): () => void;
415
+ }
416
+
417
+ declare class ActivationMonitor {
418
+ private _options;
419
+ private _watches;
420
+ private _handlers;
421
+
422
+ private _liveAt;
423
+ private _stopped;
424
+ private _offPhase;
425
+ constructor(_options: ActivationMonitorOptions);
426
+
427
+ watch(name: string, stream: ActivationStreamLike): void;
428
+
429
+ unwatch(name: string): void;
430
+
431
+ onActivation(handler: (event: ActivationEvent) => void): () => void;
432
+
433
+ dispose(): void;
434
+
435
+ private _hookFirstMediaSignals;
436
+
437
+ private _arm;
438
+
439
+ private _firstMedia;
440
+
441
+ private _settle;
442
+ private _emit;
443
+ }
444
+
445
+ declare const BACKOFF_BASE_MS = 500;
446
+
447
+ declare const BACKOFF_MAX_MS = 15000;
448
+
449
+ declare const BACKOFF_MAX_ATTEMPTS = 6;
450
+
451
+ declare function computeBackoffDelay(attempt: number, random?: () => number): number;
452
+
453
+ declare function isRetryableSessionError(error: unknown): boolean;
454
+
337
455
  declare function createStore(options: StoreOptions): Store & {
338
456
  _getInternals(): {
339
457
  multiplexer: ChannelMultiplexer;
@@ -586,6 +704,8 @@ interface MediaSession {
586
704
  lossPct: number;
587
705
  jitterMs: number;
588
706
  };
707
+
708
+ readonly firstMedia: Promise<void>;
589
709
  }
590
710
 
591
711
  interface Signaling {
@@ -734,6 +854,8 @@ declare class WebTransportSession implements MediaSession {
734
854
  private lastStats;
735
855
  private firstFrameResolve;
736
856
  private firstFrameReject;
857
+
858
+ readonly firstMedia: Promise<void>;
737
859
  constructor(offer: NonNullable<TransportOfferResponse['webtransport']>, sessionId: string, canvas: HTMLCanvasElement);
738
860
 
739
861
  start(): Promise<void>;
@@ -767,6 +889,10 @@ declare class WebRtcSession implements MediaSession {
767
889
  private deadCb;
768
890
  private deadFired;
769
891
  private unsubscribers;
892
+ private firstMediaResolve;
893
+ private firstMediaReject;
894
+
895
+ readonly firstMedia: Promise<void>;
770
896
  constructor(transport: ConsumingTransport, streamName?: string);
771
897
 
772
898
  start(): Promise<void>;
@@ -824,4 +950,4 @@ declare class FrameReassembler {
824
950
  private requestKeyframe;
825
951
  }
826
952
 
827
- export { ACTIVITY_DOM_EVENTS, ACTIVITY_FIELD, ACTIVITY_STAMP_MIN_INTERVAL_MS, type ActivityAwareness, type ActivityTracker, type ActivityTrackerOptions, App, App$1 as AppInterface, AppOptions, AttachOptions, type CaptureClaim, CaptureController, type CaptureControllerOptions, type CaptureKind, CaptureUnavailableError, ChunkReadable, type ConsumingTransport, DEFAULT_DOC_SYNC_TIMEOUT_MS, DEFAULT_PRODUCE_ACK_TIMEOUT_MS, DEFAULT_WHEN_LIVE_TIMEOUT_MS, DGRAM_HEADER_BYTES, type DgramHeader, FOREGROUND_COALESCE_MS, FrameReassembler, INPUT_PRESENCE_DEFAULT_HZ, INPUT_PRESENCE_FIELD, type InputPresenceAwareness, type InputPresencePublisher, type InputPresencePublisherOptions, type InputPresenceState, InvalidDurationError, type MediaSession, type NegotiatorOptions, PermanentLockedError, type PhaseObservable, PinRequiresActiveTempError, Presence, type PrewakeOptions, type PrewakeResult, type PrewakeStatus, ProduceAckTimeoutError, type ReassembledFrame, type ReassemblerCallbacks, type ReassemblerOptions, Recording, RecordingNotFoundError, RecordingsAccessor, RecordingsClient, type RecordingsClientOptions, RecordingsError, RecordingsUnauthorizedError, RequestAbortError, RequestCancelledError, RequestDocSyncError, RequestError, RequestOptions, RequestStreamOptions, RequestTimeoutError, RetainNotTempError, type RetentionIntent, RuntimeArtifact, RuntimeArtifactDownload, RuntimeArtifactNotFoundError, RuntimeArtifactsAccessor, RuntimeArtifactsClient, type RuntimeArtifactsClientOptions, RuntimeArtifactsError, RuntimeArtifactsUnauthorizedError, Session, SessionAllocationError, SessionEndError, SessionEndResult, SessionEndUnavailableError, SessionFailedError, SessionFailureKind, Session$1 as SessionInterface, SessionPhase, SessionPhaseName, SessionStatus, SessionStream$1 as SessionStream, type SignalCarrier, type Signaling, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, type TransportEstablishedNotify, TransportNegotiator, type TransportOfferRequest, type TransportOfferResponse, TransportSessionSignaling, TransportState, type VideoStreamOptions, WT_CONTROL_FRAME_MAX, WebRtcSession, WebTransportSession, type WhenLiveOptions, WtControlDecoder, type WtControlMessage, createActivityTracker, createInputPresencePublisher, createRecordingsClient, createRuntimeArtifactsClient, createStore, describeSessionFailure, describeSessionPhase, encodeWtControlFrame, isDurationString, isWakingPhase, normalizeRetention, observePageLifecycle, parseDgramHeader, prewake, sessionFailureFromMediaError, sharedCaptureController, videoStream, whenLive, writeDgramHeader };
953
+ export { ACTIVATION_COLD_BOOT_AFTER_MS, ACTIVATION_DEGRADED_AFTER_MS, ACTIVATION_HINT_PATH, ACTIVATION_STILL_AFTER_MS, ACTIVITY_DOM_EVENTS, ACTIVITY_FIELD, ACTIVITY_STAMP_MIN_INTERVAL_MS, ActivationEvent, ActivationMonitor, type ActivationMonitorOptions, type ActivationStreamLike, type ActivityAwareness, type ActivityTracker, type ActivityTrackerOptions, App, App$1 as AppInterface, AppOptions, AttachOptions, BACKOFF_BASE_MS, BACKOFF_MAX_ATTEMPTS, BACKOFF_MAX_MS, type CaptureClaim, CaptureController, type CaptureControllerOptions, type CaptureKind, CaptureUnavailableError, ChunkReadable, type ClientToken, ClientTokenError, type ConsumingTransport, type CreateClientTokenOptions, DEFAULT_DOC_SYNC_TIMEOUT_MS, DEFAULT_GATEWAY_URL, DEFAULT_PRODUCE_ACK_TIMEOUT_MS, DEFAULT_WHEN_LIVE_TIMEOUT_MS, DGRAM_HEADER_BYTES, type DgramHeader, FOREGROUND_COALESCE_MS, FrameReassembler, INPUT_PRESENCE_DEFAULT_HZ, INPUT_PRESENCE_FIELD, type InputPresenceAwareness, type InputPresencePublisher, type InputPresencePublisherOptions, type InputPresenceState, InvalidDurationError, type MediaSession, type NegotiatorOptions, PermanentLockedError, type PhaseObservable, PinRequiresActiveTempError, Presence, type PrewakeOptions, type PrewakeResult, type PrewakeStatus, ProduceAckTimeoutError, type ReassembledFrame, type ReassemblerCallbacks, type ReassemblerOptions, Recording, RecordingNotFoundError, RecordingsAccessor, RecordingsClient, type RecordingsClientOptions, RecordingsError, RecordingsUnauthorizedError, RequestAbortError, RequestCancelledError, RequestDocSyncError, RequestError, RequestOptions, RequestStreamOptions, RequestTimeoutError, RetainNotTempError, type RetentionIntent, RuntimeArtifact, RuntimeArtifactDownload, RuntimeArtifactNotFoundError, RuntimeArtifactsAccessor, RuntimeArtifactsClient, type RuntimeArtifactsClientOptions, RuntimeArtifactsError, RuntimeArtifactsUnauthorizedError, Session, SessionAllocationError, SessionEndError, SessionEndResult, SessionEndUnavailableError, SessionFailedError, SessionFailureKind, Session$1 as SessionInterface, SessionPhase, SessionPhaseName, SessionStatus, SessionStream$1 as SessionStream, type SignalCarrier, type Signaling, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, type TransportEstablishedNotify, TransportNegotiator, type TransportOfferRequest, type TransportOfferResponse, TransportSessionSignaling, TransportState, type VideoStreamOptions, WT_CONTROL_FRAME_MAX, WebRtcSession, WebTransportSession, type WhenLiveOptions, WtControlDecoder, type WtControlMessage, activationHintFrom, computeBackoffDelay, createActivityTracker, createClientToken, createInputPresencePublisher, createRecordingsClient, createRuntimeArtifactsClient, createStore, describeSessionFailure, describeSessionPhase, encodeWtControlFrame, isDurationString, isRetryableSessionError, isWakingPhase, normalizeRetention, observePageLifecycle, parseDgramHeader, prewake, sessionFailureFromMediaError, sharedCaptureController, videoStream, whenLive, writeDgramHeader };
@@ -1,10 +1,46 @@
1
- import { b as AppOptions, a as App$1, N as SessionPhase, U as SessionStatus, Q as SessionPhaseName, A as AccessTokenOptions$1, y as RuntimeArtifact, z as RuntimeArtifactDownload, R as Recording, G as Session$1, C as ChannelEndpoint, $ as TransportSession, c as AttachOptions, v as RecordingsAccessor, B as RuntimeArtifactsAccessor, J as SessionEndResult, V as SessionStream$1, _ as StreamDataTransport, I as SessionDocumentImpl, Z as StreamChunkOptions, g as ChunkReadable, P as Presence, k as DocConnector, w as RequestOptions, x as RequestStreamOptions, Y as StoreOptions, X as Store, e as ChannelMultiplexer, K as SessionFailureKind, a1 as TransportState } from './stream-data-rqyqR75F.js';
2
- export { L as Layer, l as LayoutConfig, m as LayoutContext, M as MediaChunkBinding, o as MediaChunkSource, p as MediaChunkSourceFactory, q as MediaRecorderChunkSourceOptions, r as PresenceState, s as RecordingBucket, t as RecordingLifecycle, u as RecordingStatus, E as RuntimeAvailability, S as SceneContext, F as SceneGraph, H as SessionDocument, O as SessionPhaseError, W as SessionText, a5 as isPendingRecording, a6 as mediaRecorderChunkSource } from './stream-data-rqyqR75F.js';
1
+ import { d as AppOptions, c as App$1, Q as SessionPhase, W as SessionStatus, U as SessionPhaseName, A as AccessTokenOptions$1, B as RuntimeArtifact, E as RuntimeArtifactDownload, R as Recording, I as Session$1, C as ChannelEndpoint, a1 as TransportSession, e as AttachOptions, a as ActivationEvent, x as RecordingsAccessor, F as RuntimeArtifactsAccessor, N as SessionEndResult, X as SessionStream$1, a0 as StreamDataTransport, K as SessionDocumentImpl, $ as StreamChunkOptions, i as ChunkReadable, P as Presence, m as DocConnector, y as RequestOptions, z as RequestStreamOptions, _ as StoreOptions, Z as Store, g as ChannelMultiplexer, O as SessionFailureKind, a3 as TransportState } from './stream-data-ChMs2mq2.js';
2
+ export { b as ActivationState, L as Layer, n as LayoutConfig, o as LayoutContext, M as MediaChunkBinding, q as MediaChunkSource, r as MediaChunkSourceFactory, s as MediaRecorderChunkSourceOptions, t as PresenceState, u as RecordingBucket, v as RecordingLifecycle, w as RecordingStatus, G as RuntimeAvailability, S as SceneContext, H as SceneGraph, J as SessionDocument, T as SessionPhaseError, Y as SessionText, a7 as isPendingRecording, a8 as mediaRecorderChunkSource } from './stream-data-ChMs2mq2.js';
3
3
  import 'yjs';
4
4
  import 'y-protocols/awareness';
5
5
 
6
6
  declare function App(appId: string, options: AppOptions): App$1;
7
7
 
8
+ declare const DEFAULT_GATEWAY_URL = "https://api.urun.sh";
9
+ interface CreateClientTokenOptions {
10
+
11
+ baseUrl?: string;
12
+
13
+ expiresIn?: number;
14
+
15
+ allowedFunctions?: string[];
16
+
17
+ allowedOrigins?: string[];
18
+
19
+ maxSessionS?: number;
20
+
21
+ subject?: string;
22
+
23
+ metadata?: Record<string, unknown>;
24
+
25
+ fetch?: typeof fetch;
26
+ }
27
+
28
+ interface ClientToken {
29
+
30
+ token: string;
31
+
32
+ expiresAt: Date;
33
+
34
+ orgId: string;
35
+ }
36
+
37
+ declare class ClientTokenError extends Error {
38
+ readonly status?: number;
39
+ constructor(message: string, status?: number);
40
+ }
41
+
42
+ declare function createClientToken(apiKey: string, options?: CreateClientTokenOptions): Promise<ClientToken>;
43
+
8
44
  interface AccessTokenOptions {
9
45
  forceRefresh?: boolean;
10
46
  reason?: 'initial' | 'unauthorized' | 'background';
@@ -191,6 +227,8 @@ declare class SessionStream implements SessionStream$1 {
191
227
 
192
228
  private _onActivity?;
193
229
  private _track;
230
+
231
+ private _overrideTrack;
194
232
  private _handlers;
195
233
  private _unsubscribeTransport;
196
234
 
@@ -217,6 +255,8 @@ declare class SessionStream implements SessionStream$1 {
217
255
  private _deliver;
218
256
  get track(): MediaStreamTrack | null;
219
257
 
258
+ _setOverrideTrack(track: MediaStreamTrack | null): void;
259
+
220
260
  private _claimBrowserProducer;
221
261
  attach(track: MediaStreamTrack): Promise<void>;
222
262
 
@@ -255,6 +295,8 @@ declare class Session implements Session$1 {
255
295
 
256
296
  private _activity;
257
297
 
298
+ private _activation;
299
+
258
300
  private _activeRequests;
259
301
  private _endHandler?;
260
302
  private _endPromise?;
@@ -270,6 +312,10 @@ declare class Session implements Session$1 {
270
312
  private _recoveryHooks;
271
313
 
272
314
  private _lifecycleUnsub;
315
+
316
+ private _dialNegotiation;
317
+
318
+ private _dialNegotiationStarted;
273
319
  constructor(sessionId: string, multiplexer: ChannelEndpoint, transport: TransportSession, recordingsAuth?: RecordingsClientOptions, artifactsAuth?: RuntimeArtifactsClientOptions);
274
320
  private _wireControlDocIncarnation;
275
321
 
@@ -284,6 +330,8 @@ declare class Session implements Session$1 {
284
330
 
285
331
  onPhase(handler: (phase: SessionPhase) => void): () => void;
286
332
 
333
+ onActivation(handler: (event: ActivationEvent) => void): () => void;
334
+
287
335
  whenLive(options?: WhenLiveOptions): Promise<void>;
288
336
 
289
337
  get recordings(): RecordingsAccessor;
@@ -326,6 +374,12 @@ declare class Session implements Session$1 {
326
374
  recover(): void;
327
375
 
328
376
  onRecovery(hook: () => void): () => void;
377
+
378
+ negotiateMediaTransport(opts?: {
379
+ allowWebTransport?: boolean;
380
+ }): void;
381
+
382
+ get mediaTransport(): 'webtransport' | 'webrtc' | null;
329
383
  end(): Promise<SessionEndResult>;
330
384
  disconnect(): void;
331
385
  }
@@ -334,6 +388,70 @@ declare const FOREGROUND_COALESCE_MS = 250;
334
388
 
335
389
  declare function observePageLifecycle(onForeground: () => void): () => void;
336
390
 
391
+ declare const ACTIVATION_STILL_AFTER_MS = 15000;
392
+
393
+ declare const ACTIVATION_COLD_BOOT_AFTER_MS = 45000;
394
+
395
+ declare const ACTIVATION_DEGRADED_AFTER_MS = 120000;
396
+
397
+ declare const ACTIVATION_HINT_PATH = "desired.activation";
398
+
399
+ declare function activationHintFrom(value: unknown): string | undefined;
400
+
401
+ interface ActivationStreamLike {
402
+
403
+ readonly track: MediaStreamTrack | null;
404
+
405
+ on(event: 'track', handler: (track: MediaStreamTrack | null) => void): () => void;
406
+ }
407
+
408
+ interface ActivationMonitorOptions {
409
+
410
+ onPhase(handler: (phase: SessionPhase) => void): () => void;
411
+
412
+ hint(): unknown;
413
+
414
+ onData?(name: string, handler: (payload: unknown) => void): () => void;
415
+ }
416
+
417
+ declare class ActivationMonitor {
418
+ private _options;
419
+ private _watches;
420
+ private _handlers;
421
+
422
+ private _liveAt;
423
+ private _stopped;
424
+ private _offPhase;
425
+ constructor(_options: ActivationMonitorOptions);
426
+
427
+ watch(name: string, stream: ActivationStreamLike): void;
428
+
429
+ unwatch(name: string): void;
430
+
431
+ onActivation(handler: (event: ActivationEvent) => void): () => void;
432
+
433
+ dispose(): void;
434
+
435
+ private _hookFirstMediaSignals;
436
+
437
+ private _arm;
438
+
439
+ private _firstMedia;
440
+
441
+ private _settle;
442
+ private _emit;
443
+ }
444
+
445
+ declare const BACKOFF_BASE_MS = 500;
446
+
447
+ declare const BACKOFF_MAX_MS = 15000;
448
+
449
+ declare const BACKOFF_MAX_ATTEMPTS = 6;
450
+
451
+ declare function computeBackoffDelay(attempt: number, random?: () => number): number;
452
+
453
+ declare function isRetryableSessionError(error: unknown): boolean;
454
+
337
455
  declare function createStore(options: StoreOptions): Store & {
338
456
  _getInternals(): {
339
457
  multiplexer: ChannelMultiplexer;
@@ -586,6 +704,8 @@ interface MediaSession {
586
704
  lossPct: number;
587
705
  jitterMs: number;
588
706
  };
707
+
708
+ readonly firstMedia: Promise<void>;
589
709
  }
590
710
 
591
711
  interface Signaling {
@@ -734,6 +854,8 @@ declare class WebTransportSession implements MediaSession {
734
854
  private lastStats;
735
855
  private firstFrameResolve;
736
856
  private firstFrameReject;
857
+
858
+ readonly firstMedia: Promise<void>;
737
859
  constructor(offer: NonNullable<TransportOfferResponse['webtransport']>, sessionId: string, canvas: HTMLCanvasElement);
738
860
 
739
861
  start(): Promise<void>;
@@ -767,6 +889,10 @@ declare class WebRtcSession implements MediaSession {
767
889
  private deadCb;
768
890
  private deadFired;
769
891
  private unsubscribers;
892
+ private firstMediaResolve;
893
+ private firstMediaReject;
894
+
895
+ readonly firstMedia: Promise<void>;
770
896
  constructor(transport: ConsumingTransport, streamName?: string);
771
897
 
772
898
  start(): Promise<void>;
@@ -824,4 +950,4 @@ declare class FrameReassembler {
824
950
  private requestKeyframe;
825
951
  }
826
952
 
827
- export { ACTIVITY_DOM_EVENTS, ACTIVITY_FIELD, ACTIVITY_STAMP_MIN_INTERVAL_MS, type ActivityAwareness, type ActivityTracker, type ActivityTrackerOptions, App, App$1 as AppInterface, AppOptions, AttachOptions, type CaptureClaim, CaptureController, type CaptureControllerOptions, type CaptureKind, CaptureUnavailableError, ChunkReadable, type ConsumingTransport, DEFAULT_DOC_SYNC_TIMEOUT_MS, DEFAULT_PRODUCE_ACK_TIMEOUT_MS, DEFAULT_WHEN_LIVE_TIMEOUT_MS, DGRAM_HEADER_BYTES, type DgramHeader, FOREGROUND_COALESCE_MS, FrameReassembler, INPUT_PRESENCE_DEFAULT_HZ, INPUT_PRESENCE_FIELD, type InputPresenceAwareness, type InputPresencePublisher, type InputPresencePublisherOptions, type InputPresenceState, InvalidDurationError, type MediaSession, type NegotiatorOptions, PermanentLockedError, type PhaseObservable, PinRequiresActiveTempError, Presence, type PrewakeOptions, type PrewakeResult, type PrewakeStatus, ProduceAckTimeoutError, type ReassembledFrame, type ReassemblerCallbacks, type ReassemblerOptions, Recording, RecordingNotFoundError, RecordingsAccessor, RecordingsClient, type RecordingsClientOptions, RecordingsError, RecordingsUnauthorizedError, RequestAbortError, RequestCancelledError, RequestDocSyncError, RequestError, RequestOptions, RequestStreamOptions, RequestTimeoutError, RetainNotTempError, type RetentionIntent, RuntimeArtifact, RuntimeArtifactDownload, RuntimeArtifactNotFoundError, RuntimeArtifactsAccessor, RuntimeArtifactsClient, type RuntimeArtifactsClientOptions, RuntimeArtifactsError, RuntimeArtifactsUnauthorizedError, Session, SessionAllocationError, SessionEndError, SessionEndResult, SessionEndUnavailableError, SessionFailedError, SessionFailureKind, Session$1 as SessionInterface, SessionPhase, SessionPhaseName, SessionStatus, SessionStream$1 as SessionStream, type SignalCarrier, type Signaling, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, type TransportEstablishedNotify, TransportNegotiator, type TransportOfferRequest, type TransportOfferResponse, TransportSessionSignaling, TransportState, type VideoStreamOptions, WT_CONTROL_FRAME_MAX, WebRtcSession, WebTransportSession, type WhenLiveOptions, WtControlDecoder, type WtControlMessage, createActivityTracker, createInputPresencePublisher, createRecordingsClient, createRuntimeArtifactsClient, createStore, describeSessionFailure, describeSessionPhase, encodeWtControlFrame, isDurationString, isWakingPhase, normalizeRetention, observePageLifecycle, parseDgramHeader, prewake, sessionFailureFromMediaError, sharedCaptureController, videoStream, whenLive, writeDgramHeader };
953
+ export { ACTIVATION_COLD_BOOT_AFTER_MS, ACTIVATION_DEGRADED_AFTER_MS, ACTIVATION_HINT_PATH, ACTIVATION_STILL_AFTER_MS, ACTIVITY_DOM_EVENTS, ACTIVITY_FIELD, ACTIVITY_STAMP_MIN_INTERVAL_MS, ActivationEvent, ActivationMonitor, type ActivationMonitorOptions, type ActivationStreamLike, type ActivityAwareness, type ActivityTracker, type ActivityTrackerOptions, App, App$1 as AppInterface, AppOptions, AttachOptions, BACKOFF_BASE_MS, BACKOFF_MAX_ATTEMPTS, BACKOFF_MAX_MS, type CaptureClaim, CaptureController, type CaptureControllerOptions, type CaptureKind, CaptureUnavailableError, ChunkReadable, type ClientToken, ClientTokenError, type ConsumingTransport, type CreateClientTokenOptions, DEFAULT_DOC_SYNC_TIMEOUT_MS, DEFAULT_GATEWAY_URL, DEFAULT_PRODUCE_ACK_TIMEOUT_MS, DEFAULT_WHEN_LIVE_TIMEOUT_MS, DGRAM_HEADER_BYTES, type DgramHeader, FOREGROUND_COALESCE_MS, FrameReassembler, INPUT_PRESENCE_DEFAULT_HZ, INPUT_PRESENCE_FIELD, type InputPresenceAwareness, type InputPresencePublisher, type InputPresencePublisherOptions, type InputPresenceState, InvalidDurationError, type MediaSession, type NegotiatorOptions, PermanentLockedError, type PhaseObservable, PinRequiresActiveTempError, Presence, type PrewakeOptions, type PrewakeResult, type PrewakeStatus, ProduceAckTimeoutError, type ReassembledFrame, type ReassemblerCallbacks, type ReassemblerOptions, Recording, RecordingNotFoundError, RecordingsAccessor, RecordingsClient, type RecordingsClientOptions, RecordingsError, RecordingsUnauthorizedError, RequestAbortError, RequestCancelledError, RequestDocSyncError, RequestError, RequestOptions, RequestStreamOptions, RequestTimeoutError, RetainNotTempError, type RetentionIntent, RuntimeArtifact, RuntimeArtifactDownload, RuntimeArtifactNotFoundError, RuntimeArtifactsAccessor, RuntimeArtifactsClient, type RuntimeArtifactsClientOptions, RuntimeArtifactsError, RuntimeArtifactsUnauthorizedError, Session, SessionAllocationError, SessionEndError, SessionEndResult, SessionEndUnavailableError, SessionFailedError, SessionFailureKind, Session$1 as SessionInterface, SessionPhase, SessionPhaseName, SessionStatus, SessionStream$1 as SessionStream, type SignalCarrier, type Signaling, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, type TransportEstablishedNotify, TransportNegotiator, type TransportOfferRequest, type TransportOfferResponse, TransportSessionSignaling, TransportState, type VideoStreamOptions, WT_CONTROL_FRAME_MAX, WebRtcSession, WebTransportSession, type WhenLiveOptions, WtControlDecoder, type WtControlMessage, activationHintFrom, computeBackoffDelay, createActivityTracker, createClientToken, createInputPresencePublisher, createRecordingsClient, createRuntimeArtifactsClient, createStore, describeSessionFailure, describeSessionPhase, encodeWtControlFrame, isDurationString, isRetryableSessionError, isWakingPhase, normalizeRetention, observePageLifecycle, parseDgramHeader, prewake, sessionFailureFromMediaError, sharedCaptureController, videoStream, whenLive, writeDgramHeader };