@urun-sh/core 0.3.7 → 0.4.0

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,8 +1,60 @@
1
- import { g as AppOptions, f as App$1, ag as SessionPhase, am as SessionStatus, ai as SessionPhaseName, A as AccessTokenOptions, a1 as RuntimeArtifact, a2 as RuntimeArtifactDownload, V as Recording, aC as TransportState, aa as Session$1, C as ChannelEndpoint, az as TransportSession, h as AttachOptions, ab as SessionDiagnostic, b as ActivationEvent, al as SessionStatsSample, z as GenerationTick, Z as RecordingsAccessor, a3 as RuntimeArtifactsAccessor, ae as SessionEndResult, an as SessionStream$1, au as StreamDataTransport, ad as SessionDocumentImpl, at as StreamChunkOptions, m as ChunkReadable, O as Presence, v as DocConnector, x as DocTokenSupplier, w as DocServerUrlResolver, $ as RequestOptions, a0 as RequestStreamOptions, as as StoreOptions, ar as Store, k as ChannelMultiplexer, af as SessionFailureKind, H as MediaSession, P as PathHealthReporting, ay as TransportOfferResponse, aH as WtAudioLaneSeam, aI as WtAudioUplinkSeam, aP as WtVideoUplinkSeam, aO as WtDataUplinkSender, K as PathLiveness, aM as WtDataLaneSink } from './stream-data-W9S0z8Wv.mjs';
2
- export { c as ActivationState, i as AudioPlayoutOptions, D as DERIVED_LEG_SEP, n as DGRAM_HEADER_BYTES, r as DerivedLegRole, s as DgramHeader, u as DocConnectionState, G as GENERATION_TICK_EMIT_INTERVAL_MS, y as GENERATION_TICK_MAX_EXTRAPOLATION_MS, I as InboundStatsSample, M as MediaChunkBinding, B as MediaChunkSource, E as MediaChunkSourceFactory, F as MediaRecorderChunkSourceOptions, N as NegotiatorDataLaneSeam, J as NegotiatorOptions, Q as PresenceState, R as PrewakeOptions, S as PrewakeResult, T as PrewakeStatus, U as QuicStreamDataTransport, W as RecordingBucket, X as RecordingLifecycle, Y as RecordingStatus, _ as ReleaseSessionBeaconOptions, a4 as RuntimeAvailability, a5 as RuntimeWakeDetail, a6 as RuntimeWakeGolden, a7 as RuntimeWakeReasonCode, a8 as SIGNALING_PROTOCOL_VERSION, a9 as STREAM_END, ac as SessionDocument, ah as SessionPhaseError, ak as SessionStatsOptions, ao as SessionText, ap as SignalCarrier, aq as Signaling, av as TransportEstablishedNotify, aw as TransportNegotiator, ax as TransportOfferRequest, aB as TransportSessionSignaling, aD as VideoPlayoutOptions, aE as WT_CONTROL_FRAME_MAX, aF as WT_DATA_STREAM_VERSION, aG as WatchGenerationTickOptions, aJ as WtControlDecoder, aK as WtControlMessage, aL as WtDataEnvelope, aN as WtDataStreamParser, aR as consumeWtDataStreams, aU as decodeStreamEnvelope, aW as derivedLegName, aX as derivedLegRole, aY as encodeStreamEnvelope, aZ as encodeWtControlFrame, a_ as isPendingRecording, a$ as mediaRecorderChunkSource, b0 as parseDgramHeader, b1 as prewake, b2 as releaseSessionBeacon, b5 as watchGenerationTick, b6 as writeDgramHeader } from './stream-data-W9S0z8Wv.mjs';
1
+ import { ac as SessionDirectoryRequestOptions, g as AppOptions, f as App$1, ah as SessionPhase, an as SessionStatus, aj as SessionPhaseName, A as AccessTokenOptions, a1 as RuntimeArtifact, a2 as RuntimeArtifactDownload, V as Recording, aE as TransportState, aa as Session$1, C as ChannelEndpoint, aB as TransportSession, h as AttachOptions, ab as SessionDiagnostic, b as ActivationEvent, am as SessionStatsSample, z as GenerationTick, Z as RecordingsAccessor, a3 as RuntimeArtifactsAccessor, af as SessionEndResult, ao as SessionStream$1, aw as StreamDataTransport, ae as SessionDocumentImpl, av as StreamChunkOptions, m as ChunkReadable, O as Presence, v as DocConnector, x as DocTokenSupplier, w as DocServerUrlResolver, $ as RequestOptions, a0 as RequestStreamOptions, au as StoreOptions, at as Store, k as ChannelMultiplexer, ag as SessionFailureKind, H as MediaSession, P as PathHealthReporting, aA as TransportOfferResponse, aJ as WtAudioLaneSeam, aK as WtAudioUplinkSeam, aR as WtVideoUplinkSeam, aQ as WtDataUplinkSender, K as PathLiveness, aO as WtDataLaneSink } from './stream-data-CXrgcYCu.mjs';
2
+ export { c as ActivationState, i as AudioPlayoutOptions, D as DERIVED_LEG_SEP, n as DGRAM_HEADER_BYTES, r as DerivedLegRole, s as DgramHeader, u as DocConnectionState, G as GENERATION_TICK_EMIT_INTERVAL_MS, y as GENERATION_TICK_MAX_EXTRAPOLATION_MS, I as InboundStatsSample, M as MediaChunkBinding, B as MediaChunkSource, E as MediaChunkSourceFactory, F as MediaRecorderChunkSourceOptions, N as NegotiatorDataLaneSeam, J as NegotiatorOptions, Q as PresenceState, R as PrewakeOptions, S as PrewakeResult, T as PrewakeStatus, U as QuicStreamDataTransport, W as RecordingBucket, X as RecordingLifecycle, Y as RecordingStatus, _ as ReleaseSessionBeaconOptions, a4 as RuntimeAvailability, a5 as RuntimeWakeDetail, a6 as RuntimeWakeGolden, a7 as RuntimeWakeReasonCode, a8 as SIGNALING_PROTOCOL_VERSION, a9 as STREAM_END, ad as SessionDocument, ai as SessionPhaseError, al as SessionStatsOptions, ap as SessionText, aq as SignalCarrier, ar as Signaling, as as StartSessionOptions, ax as TransportEstablishedNotify, ay as TransportNegotiator, az as TransportOfferRequest, aD as TransportSessionSignaling, aF as VideoPlayoutOptions, aG as WT_CONTROL_FRAME_MAX, aH as WT_DATA_STREAM_VERSION, aI as WatchGenerationTickOptions, aL as WtControlDecoder, aM as WtControlMessage, aN as WtDataEnvelope, aP as WtDataStreamParser, aT as consumeWtDataStreams, aW as decodeStreamEnvelope, aY as derivedLegName, aZ as derivedLegRole, a_ as encodeStreamEnvelope, a$ as encodeWtControlFrame, b0 as isPendingRecording, b1 as mediaRecorderChunkSource, b2 as parseDgramHeader, b3 as prewake, b4 as releaseSessionBeacon, b7 as watchGenerationTick, b8 as writeDgramHeader } from './stream-data-CXrgcYCu.mjs';
3
3
  import 'yjs';
4
4
  import 'y-protocols/awareness';
5
5
 
6
+ type SessionState = 'paused' | 'acquiring' | 'live';
7
+
8
+ interface SessionSummary {
9
+
10
+ readonly id: string;
11
+
12
+ readonly label: string | null;
13
+ readonly state: SessionState;
14
+ readonly app: string;
15
+ readonly functionName: string;
16
+ readonly createdAt: Date | null;
17
+
18
+ readonly lastActiveAt: Date | null;
19
+
20
+ readonly archived: boolean;
21
+
22
+ readonly preview: string | null;
23
+
24
+ readonly recordingsExpired: boolean;
25
+ }
26
+ interface ListOptions {
27
+
28
+ app?: string;
29
+
30
+ functionName?: string;
31
+
32
+ includeArchived?: boolean;
33
+ limit?: number;
34
+ cursor?: string;
35
+ }
36
+ interface ListResult {
37
+ readonly sessions: readonly SessionSummary[];
38
+
39
+ readonly nextCursor: string | null;
40
+ }
41
+
42
+ declare class SessionDirectory {
43
+ private readonly _request;
44
+ private readonly _app;
45
+ constructor(app: string, request: SessionDirectoryRequestOptions);
46
+
47
+ list(options?: ListOptions): Promise<ListResult>;
48
+
49
+ end(sessionId: string): Promise<void>;
50
+
51
+ archive(sessionId: string): Promise<void>;
52
+
53
+ unarchive(sessionId: string): Promise<void>;
54
+ }
55
+
56
+ declare function sessionDirectory(appId: string, options: AppOptions): SessionDirectory;
57
+
6
58
  declare function App(appId: string, options: AppOptions): App$1;
7
59
 
8
60
  declare const DEFAULT_GATEWAY_URL = "https://api.urun.sh";
@@ -47,7 +99,7 @@ declare function createClientToken(apiKey: string, options?: CreateClientTokenOp
47
99
 
48
100
  declare function isWakingPhase(phase: SessionPhase | SessionPhaseName | null | undefined): boolean;
49
101
 
50
- declare function isServerTerminalPhase(phase: SessionPhase | null | undefined): boolean;
102
+ declare function isPausedPhase(phase: SessionPhase | SessionPhaseName | null | undefined): boolean;
51
103
 
52
104
  interface PhaseObservable {
53
105
 
@@ -477,7 +529,10 @@ declare class Session implements Session$1 {
477
529
 
478
530
  get mediaTransport(): 'webtransport' | 'webrtc' | null;
479
531
  end(): Promise<SessionEndResult>;
532
+
480
533
  disconnect(): void;
534
+
535
+ detach(): void;
481
536
  }
482
537
 
483
538
  declare const FOREGROUND_COALESCE_MS = 250;
@@ -528,6 +583,8 @@ declare class ActivationMonitor {
528
583
  private _offPhase;
529
584
  constructor(_options: ActivationMonitorOptions);
530
585
 
586
+ private _park;
587
+
531
588
  watch(name: string, stream: ActivationStreamLike): void;
532
589
 
533
590
  unwatch(name: string): void;
@@ -589,6 +646,16 @@ declare class SessionEndError extends Error {
589
646
  });
590
647
  }
591
648
 
649
+ declare class SessionDirectoryError extends Error {
650
+ readonly code: string;
651
+ readonly httpStatus?: number;
652
+ constructor(message: string, options?: {
653
+ code?: string;
654
+ httpStatus?: number;
655
+ cause?: unknown;
656
+ });
657
+ }
658
+
592
659
  declare class RequestError extends Error {
593
660
 
594
661
  readonly requestId?: string;
@@ -1188,4 +1255,4 @@ declare class FrameReassembler {
1188
1255
  private requestKeyframe;
1189
1256
  }
1190
1257
 
1191
- 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 CameraWarp, type CameraWarpOptions, type CameraWarpTransform, type CaptureClaim, CaptureController, type CaptureControllerOptions, type CaptureKind, CaptureUnavailableError, ChunkReadable, type ClientToken, ClientTokenError, type ConsumingTransport, type CreateClientTokenOptions, type CreditBalance, type CreditLedgerEntry, CreditsClient, type CreditsClientOptions, CreditsError, type CreditsLedgerOptions, CreditsUnauthorizedError, DATA_CHANNEL_MESSAGE_CEILING, DEFAULT_DOC_SYNC_TIMEOUT_MS, DEFAULT_GATEWAY_URL, DEFAULT_PRODUCE_ACK_TIMEOUT_MS, DEFAULT_REFERENCE_JPEG_QUALITY, DEFAULT_REFERENCE_MAX_SIZE, DEFAULT_WHEN_LIVE_TIMEOUT_MS, DocTokenSupplier, FOCUS_FIELD, FOREGROUND_COALESCE_MS, FrameReassembler, GenerationTick, INPUT_PRESENCE_DEFAULT_HZ, INPUT_PRESENCE_FIELD, type InputPresenceAwareness, type InputPresencePublisher, type InputPresencePublisherOptions, type InputPresenceState, InvalidDurationError, LEGACY_ACTIVATION_HINT_PATH, MediaSession, type NormalizeReferenceImageOptions, PLATFORM_DOC_NAME, PermanentLockedError, type PhaseObservable, PinRequiresActiveTempError, Presence, type PresenceAwarenessSink, type PresenceConnectivityState, type PresenceFocus, type PresenceInteractionKind, PresenceTracker, type PresenceTrackerOptions, type PresenceTransportLike, type PresenceVisibility, ProduceAckTimeoutError, type ReassembledFrame, type ReassemblerCallbacks, type ReassemblerOptions, Recording, RecordingNotFoundError, RecordingsAccessor, RecordingsClient, type RecordingsClientOptions, RecordingsError, RecordingsUnauthorizedError, type ReferenceImage, type ReferenceImageSource, type ReferenceImageType, RequestAbortError, RequestCancelledError, RequestDocSyncError, RequestError, RequestOptions, RequestStreamOptions, RequestTimeoutError, RetainNotTempError, type RetentionIntent, RuntimeArtifact, RuntimeArtifactDownload, RuntimeArtifactNotFoundError, RuntimeArtifactsAccessor, RuntimeArtifactsClient, type RuntimeArtifactsClientOptions, RuntimeArtifactsError, RuntimeArtifactsUnauthorizedError, Session, SessionAllocationError, SessionDiagnostic, SessionEndError, SessionEndResult, SessionEndUnavailableError, SessionFailedError, SessionFailureKind, Session$1 as SessionInterface, SessionPhase, SessionPhaseName, SessionStatsSample, SessionStatus, SessionStream$1 as SessionStream, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, TransportOfferResponse, TransportSessionMismatchError, TransportState, URUN_DEV_ENV, USER_ACTIVITY_FIELD, USER_ACTIVITY_MIN_INTERVAL_MS, type UserActivityPayload, VISIBILITY_FIELD, type VideoStreamOptions, WIRE_MESSAGE_BUDGET, WebRtcSession, WebTransportSession, type WhenLiveOptions, WtDataLaneSink, activationHintFrom, cameraCaptureAvailable, captureStillFromVideo, computeBackoffDelay, createActivityTracker, createCameraWarp, createClientToken, createCreditsClient, createInputPresencePublisher, createRecordingsClient, createRuntimeArtifactsClient, createStore, describeSessionFailure, describeSessionPhase, fitWithin, isDurationString, isRetryableSessionError, isServerTerminalPhase, isWakingPhase, normalizeReferenceImage, normalizeRetention, observeLeaveConfirm, observePageLifecycle, observePageTeardown, referenceImageErrorMessage, sessionFailureFromMediaError, sharedCaptureController, videoStream, whenLive };
1258
+ 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 CameraWarp, type CameraWarpOptions, type CameraWarpTransform, type CaptureClaim, CaptureController, type CaptureControllerOptions, type CaptureKind, CaptureUnavailableError, ChunkReadable, type ClientToken, ClientTokenError, type ConsumingTransport, type CreateClientTokenOptions, type CreditBalance, type CreditLedgerEntry, CreditsClient, type CreditsClientOptions, CreditsError, type CreditsLedgerOptions, CreditsUnauthorizedError, DATA_CHANNEL_MESSAGE_CEILING, DEFAULT_DOC_SYNC_TIMEOUT_MS, DEFAULT_GATEWAY_URL, DEFAULT_PRODUCE_ACK_TIMEOUT_MS, DEFAULT_REFERENCE_JPEG_QUALITY, DEFAULT_REFERENCE_MAX_SIZE, DEFAULT_WHEN_LIVE_TIMEOUT_MS, DocTokenSupplier, FOCUS_FIELD, FOREGROUND_COALESCE_MS, FrameReassembler, GenerationTick, INPUT_PRESENCE_DEFAULT_HZ, INPUT_PRESENCE_FIELD, type InputPresenceAwareness, type InputPresencePublisher, type InputPresencePublisherOptions, type InputPresenceState, InvalidDurationError, LEGACY_ACTIVATION_HINT_PATH, type ListOptions, type ListResult, MediaSession, type NormalizeReferenceImageOptions, PLATFORM_DOC_NAME, PermanentLockedError, type PhaseObservable, PinRequiresActiveTempError, Presence, type PresenceAwarenessSink, type PresenceConnectivityState, type PresenceFocus, type PresenceInteractionKind, PresenceTracker, type PresenceTrackerOptions, type PresenceTransportLike, type PresenceVisibility, ProduceAckTimeoutError, type ReassembledFrame, type ReassemblerCallbacks, type ReassemblerOptions, Recording, RecordingNotFoundError, RecordingsAccessor, RecordingsClient, type RecordingsClientOptions, RecordingsError, RecordingsUnauthorizedError, type ReferenceImage, type ReferenceImageSource, type ReferenceImageType, RequestAbortError, RequestCancelledError, RequestDocSyncError, RequestError, RequestOptions, RequestStreamOptions, RequestTimeoutError, RetainNotTempError, type RetentionIntent, RuntimeArtifact, RuntimeArtifactDownload, RuntimeArtifactNotFoundError, RuntimeArtifactsAccessor, RuntimeArtifactsClient, type RuntimeArtifactsClientOptions, RuntimeArtifactsError, RuntimeArtifactsUnauthorizedError, Session, SessionAllocationError, SessionDiagnostic, SessionDirectory, SessionDirectoryError, SessionEndError, SessionEndResult, SessionEndUnavailableError, SessionFailedError, SessionFailureKind, Session$1 as SessionInterface, SessionPhase, SessionPhaseName, type SessionState, SessionStatsSample, SessionStatus, SessionStream$1 as SessionStream, type SessionSummary, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, TransportOfferResponse, TransportSessionMismatchError, TransportState, URUN_DEV_ENV, USER_ACTIVITY_FIELD, USER_ACTIVITY_MIN_INTERVAL_MS, type UserActivityPayload, VISIBILITY_FIELD, type VideoStreamOptions, WIRE_MESSAGE_BUDGET, WebRtcSession, WebTransportSession, type WhenLiveOptions, WtDataLaneSink, activationHintFrom, cameraCaptureAvailable, captureStillFromVideo, computeBackoffDelay, createActivityTracker, createCameraWarp, createClientToken, createCreditsClient, createInputPresencePublisher, createRecordingsClient, createRuntimeArtifactsClient, createStore, describeSessionFailure, describeSessionPhase, fitWithin, isDurationString, isPausedPhase, isRetryableSessionError, isWakingPhase, normalizeReferenceImage, normalizeRetention, observeLeaveConfirm, observePageLifecycle, observePageTeardown, referenceImageErrorMessage, sessionDirectory, sessionFailureFromMediaError, sharedCaptureController, videoStream, whenLive };
@@ -1,8 +1,60 @@
1
- import { g as AppOptions, f as App$1, ag as SessionPhase, am as SessionStatus, ai as SessionPhaseName, A as AccessTokenOptions, a1 as RuntimeArtifact, a2 as RuntimeArtifactDownload, V as Recording, aC as TransportState, aa as Session$1, C as ChannelEndpoint, az as TransportSession, h as AttachOptions, ab as SessionDiagnostic, b as ActivationEvent, al as SessionStatsSample, z as GenerationTick, Z as RecordingsAccessor, a3 as RuntimeArtifactsAccessor, ae as SessionEndResult, an as SessionStream$1, au as StreamDataTransport, ad as SessionDocumentImpl, at as StreamChunkOptions, m as ChunkReadable, O as Presence, v as DocConnector, x as DocTokenSupplier, w as DocServerUrlResolver, $ as RequestOptions, a0 as RequestStreamOptions, as as StoreOptions, ar as Store, k as ChannelMultiplexer, af as SessionFailureKind, H as MediaSession, P as PathHealthReporting, ay as TransportOfferResponse, aH as WtAudioLaneSeam, aI as WtAudioUplinkSeam, aP as WtVideoUplinkSeam, aO as WtDataUplinkSender, K as PathLiveness, aM as WtDataLaneSink } from './stream-data-W9S0z8Wv.js';
2
- export { c as ActivationState, i as AudioPlayoutOptions, D as DERIVED_LEG_SEP, n as DGRAM_HEADER_BYTES, r as DerivedLegRole, s as DgramHeader, u as DocConnectionState, G as GENERATION_TICK_EMIT_INTERVAL_MS, y as GENERATION_TICK_MAX_EXTRAPOLATION_MS, I as InboundStatsSample, M as MediaChunkBinding, B as MediaChunkSource, E as MediaChunkSourceFactory, F as MediaRecorderChunkSourceOptions, N as NegotiatorDataLaneSeam, J as NegotiatorOptions, Q as PresenceState, R as PrewakeOptions, S as PrewakeResult, T as PrewakeStatus, U as QuicStreamDataTransport, W as RecordingBucket, X as RecordingLifecycle, Y as RecordingStatus, _ as ReleaseSessionBeaconOptions, a4 as RuntimeAvailability, a5 as RuntimeWakeDetail, a6 as RuntimeWakeGolden, a7 as RuntimeWakeReasonCode, a8 as SIGNALING_PROTOCOL_VERSION, a9 as STREAM_END, ac as SessionDocument, ah as SessionPhaseError, ak as SessionStatsOptions, ao as SessionText, ap as SignalCarrier, aq as Signaling, av as TransportEstablishedNotify, aw as TransportNegotiator, ax as TransportOfferRequest, aB as TransportSessionSignaling, aD as VideoPlayoutOptions, aE as WT_CONTROL_FRAME_MAX, aF as WT_DATA_STREAM_VERSION, aG as WatchGenerationTickOptions, aJ as WtControlDecoder, aK as WtControlMessage, aL as WtDataEnvelope, aN as WtDataStreamParser, aR as consumeWtDataStreams, aU as decodeStreamEnvelope, aW as derivedLegName, aX as derivedLegRole, aY as encodeStreamEnvelope, aZ as encodeWtControlFrame, a_ as isPendingRecording, a$ as mediaRecorderChunkSource, b0 as parseDgramHeader, b1 as prewake, b2 as releaseSessionBeacon, b5 as watchGenerationTick, b6 as writeDgramHeader } from './stream-data-W9S0z8Wv.js';
1
+ import { ac as SessionDirectoryRequestOptions, g as AppOptions, f as App$1, ah as SessionPhase, an as SessionStatus, aj as SessionPhaseName, A as AccessTokenOptions, a1 as RuntimeArtifact, a2 as RuntimeArtifactDownload, V as Recording, aE as TransportState, aa as Session$1, C as ChannelEndpoint, aB as TransportSession, h as AttachOptions, ab as SessionDiagnostic, b as ActivationEvent, am as SessionStatsSample, z as GenerationTick, Z as RecordingsAccessor, a3 as RuntimeArtifactsAccessor, af as SessionEndResult, ao as SessionStream$1, aw as StreamDataTransport, ae as SessionDocumentImpl, av as StreamChunkOptions, m as ChunkReadable, O as Presence, v as DocConnector, x as DocTokenSupplier, w as DocServerUrlResolver, $ as RequestOptions, a0 as RequestStreamOptions, au as StoreOptions, at as Store, k as ChannelMultiplexer, ag as SessionFailureKind, H as MediaSession, P as PathHealthReporting, aA as TransportOfferResponse, aJ as WtAudioLaneSeam, aK as WtAudioUplinkSeam, aR as WtVideoUplinkSeam, aQ as WtDataUplinkSender, K as PathLiveness, aO as WtDataLaneSink } from './stream-data-CXrgcYCu.js';
2
+ export { c as ActivationState, i as AudioPlayoutOptions, D as DERIVED_LEG_SEP, n as DGRAM_HEADER_BYTES, r as DerivedLegRole, s as DgramHeader, u as DocConnectionState, G as GENERATION_TICK_EMIT_INTERVAL_MS, y as GENERATION_TICK_MAX_EXTRAPOLATION_MS, I as InboundStatsSample, M as MediaChunkBinding, B as MediaChunkSource, E as MediaChunkSourceFactory, F as MediaRecorderChunkSourceOptions, N as NegotiatorDataLaneSeam, J as NegotiatorOptions, Q as PresenceState, R as PrewakeOptions, S as PrewakeResult, T as PrewakeStatus, U as QuicStreamDataTransport, W as RecordingBucket, X as RecordingLifecycle, Y as RecordingStatus, _ as ReleaseSessionBeaconOptions, a4 as RuntimeAvailability, a5 as RuntimeWakeDetail, a6 as RuntimeWakeGolden, a7 as RuntimeWakeReasonCode, a8 as SIGNALING_PROTOCOL_VERSION, a9 as STREAM_END, ad as SessionDocument, ai as SessionPhaseError, al as SessionStatsOptions, ap as SessionText, aq as SignalCarrier, ar as Signaling, as as StartSessionOptions, ax as TransportEstablishedNotify, ay as TransportNegotiator, az as TransportOfferRequest, aD as TransportSessionSignaling, aF as VideoPlayoutOptions, aG as WT_CONTROL_FRAME_MAX, aH as WT_DATA_STREAM_VERSION, aI as WatchGenerationTickOptions, aL as WtControlDecoder, aM as WtControlMessage, aN as WtDataEnvelope, aP as WtDataStreamParser, aT as consumeWtDataStreams, aW as decodeStreamEnvelope, aY as derivedLegName, aZ as derivedLegRole, a_ as encodeStreamEnvelope, a$ as encodeWtControlFrame, b0 as isPendingRecording, b1 as mediaRecorderChunkSource, b2 as parseDgramHeader, b3 as prewake, b4 as releaseSessionBeacon, b7 as watchGenerationTick, b8 as writeDgramHeader } from './stream-data-CXrgcYCu.js';
3
3
  import 'yjs';
4
4
  import 'y-protocols/awareness';
5
5
 
6
+ type SessionState = 'paused' | 'acquiring' | 'live';
7
+
8
+ interface SessionSummary {
9
+
10
+ readonly id: string;
11
+
12
+ readonly label: string | null;
13
+ readonly state: SessionState;
14
+ readonly app: string;
15
+ readonly functionName: string;
16
+ readonly createdAt: Date | null;
17
+
18
+ readonly lastActiveAt: Date | null;
19
+
20
+ readonly archived: boolean;
21
+
22
+ readonly preview: string | null;
23
+
24
+ readonly recordingsExpired: boolean;
25
+ }
26
+ interface ListOptions {
27
+
28
+ app?: string;
29
+
30
+ functionName?: string;
31
+
32
+ includeArchived?: boolean;
33
+ limit?: number;
34
+ cursor?: string;
35
+ }
36
+ interface ListResult {
37
+ readonly sessions: readonly SessionSummary[];
38
+
39
+ readonly nextCursor: string | null;
40
+ }
41
+
42
+ declare class SessionDirectory {
43
+ private readonly _request;
44
+ private readonly _app;
45
+ constructor(app: string, request: SessionDirectoryRequestOptions);
46
+
47
+ list(options?: ListOptions): Promise<ListResult>;
48
+
49
+ end(sessionId: string): Promise<void>;
50
+
51
+ archive(sessionId: string): Promise<void>;
52
+
53
+ unarchive(sessionId: string): Promise<void>;
54
+ }
55
+
56
+ declare function sessionDirectory(appId: string, options: AppOptions): SessionDirectory;
57
+
6
58
  declare function App(appId: string, options: AppOptions): App$1;
7
59
 
8
60
  declare const DEFAULT_GATEWAY_URL = "https://api.urun.sh";
@@ -47,7 +99,7 @@ declare function createClientToken(apiKey: string, options?: CreateClientTokenOp
47
99
 
48
100
  declare function isWakingPhase(phase: SessionPhase | SessionPhaseName | null | undefined): boolean;
49
101
 
50
- declare function isServerTerminalPhase(phase: SessionPhase | null | undefined): boolean;
102
+ declare function isPausedPhase(phase: SessionPhase | SessionPhaseName | null | undefined): boolean;
51
103
 
52
104
  interface PhaseObservable {
53
105
 
@@ -477,7 +529,10 @@ declare class Session implements Session$1 {
477
529
 
478
530
  get mediaTransport(): 'webtransport' | 'webrtc' | null;
479
531
  end(): Promise<SessionEndResult>;
532
+
480
533
  disconnect(): void;
534
+
535
+ detach(): void;
481
536
  }
482
537
 
483
538
  declare const FOREGROUND_COALESCE_MS = 250;
@@ -528,6 +583,8 @@ declare class ActivationMonitor {
528
583
  private _offPhase;
529
584
  constructor(_options: ActivationMonitorOptions);
530
585
 
586
+ private _park;
587
+
531
588
  watch(name: string, stream: ActivationStreamLike): void;
532
589
 
533
590
  unwatch(name: string): void;
@@ -589,6 +646,16 @@ declare class SessionEndError extends Error {
589
646
  });
590
647
  }
591
648
 
649
+ declare class SessionDirectoryError extends Error {
650
+ readonly code: string;
651
+ readonly httpStatus?: number;
652
+ constructor(message: string, options?: {
653
+ code?: string;
654
+ httpStatus?: number;
655
+ cause?: unknown;
656
+ });
657
+ }
658
+
592
659
  declare class RequestError extends Error {
593
660
 
594
661
  readonly requestId?: string;
@@ -1188,4 +1255,4 @@ declare class FrameReassembler {
1188
1255
  private requestKeyframe;
1189
1256
  }
1190
1257
 
1191
- 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 CameraWarp, type CameraWarpOptions, type CameraWarpTransform, type CaptureClaim, CaptureController, type CaptureControllerOptions, type CaptureKind, CaptureUnavailableError, ChunkReadable, type ClientToken, ClientTokenError, type ConsumingTransport, type CreateClientTokenOptions, type CreditBalance, type CreditLedgerEntry, CreditsClient, type CreditsClientOptions, CreditsError, type CreditsLedgerOptions, CreditsUnauthorizedError, DATA_CHANNEL_MESSAGE_CEILING, DEFAULT_DOC_SYNC_TIMEOUT_MS, DEFAULT_GATEWAY_URL, DEFAULT_PRODUCE_ACK_TIMEOUT_MS, DEFAULT_REFERENCE_JPEG_QUALITY, DEFAULT_REFERENCE_MAX_SIZE, DEFAULT_WHEN_LIVE_TIMEOUT_MS, DocTokenSupplier, FOCUS_FIELD, FOREGROUND_COALESCE_MS, FrameReassembler, GenerationTick, INPUT_PRESENCE_DEFAULT_HZ, INPUT_PRESENCE_FIELD, type InputPresenceAwareness, type InputPresencePublisher, type InputPresencePublisherOptions, type InputPresenceState, InvalidDurationError, LEGACY_ACTIVATION_HINT_PATH, MediaSession, type NormalizeReferenceImageOptions, PLATFORM_DOC_NAME, PermanentLockedError, type PhaseObservable, PinRequiresActiveTempError, Presence, type PresenceAwarenessSink, type PresenceConnectivityState, type PresenceFocus, type PresenceInteractionKind, PresenceTracker, type PresenceTrackerOptions, type PresenceTransportLike, type PresenceVisibility, ProduceAckTimeoutError, type ReassembledFrame, type ReassemblerCallbacks, type ReassemblerOptions, Recording, RecordingNotFoundError, RecordingsAccessor, RecordingsClient, type RecordingsClientOptions, RecordingsError, RecordingsUnauthorizedError, type ReferenceImage, type ReferenceImageSource, type ReferenceImageType, RequestAbortError, RequestCancelledError, RequestDocSyncError, RequestError, RequestOptions, RequestStreamOptions, RequestTimeoutError, RetainNotTempError, type RetentionIntent, RuntimeArtifact, RuntimeArtifactDownload, RuntimeArtifactNotFoundError, RuntimeArtifactsAccessor, RuntimeArtifactsClient, type RuntimeArtifactsClientOptions, RuntimeArtifactsError, RuntimeArtifactsUnauthorizedError, Session, SessionAllocationError, SessionDiagnostic, SessionEndError, SessionEndResult, SessionEndUnavailableError, SessionFailedError, SessionFailureKind, Session$1 as SessionInterface, SessionPhase, SessionPhaseName, SessionStatsSample, SessionStatus, SessionStream$1 as SessionStream, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, TransportOfferResponse, TransportSessionMismatchError, TransportState, URUN_DEV_ENV, USER_ACTIVITY_FIELD, USER_ACTIVITY_MIN_INTERVAL_MS, type UserActivityPayload, VISIBILITY_FIELD, type VideoStreamOptions, WIRE_MESSAGE_BUDGET, WebRtcSession, WebTransportSession, type WhenLiveOptions, WtDataLaneSink, activationHintFrom, cameraCaptureAvailable, captureStillFromVideo, computeBackoffDelay, createActivityTracker, createCameraWarp, createClientToken, createCreditsClient, createInputPresencePublisher, createRecordingsClient, createRuntimeArtifactsClient, createStore, describeSessionFailure, describeSessionPhase, fitWithin, isDurationString, isRetryableSessionError, isServerTerminalPhase, isWakingPhase, normalizeReferenceImage, normalizeRetention, observeLeaveConfirm, observePageLifecycle, observePageTeardown, referenceImageErrorMessage, sessionFailureFromMediaError, sharedCaptureController, videoStream, whenLive };
1258
+ 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 CameraWarp, type CameraWarpOptions, type CameraWarpTransform, type CaptureClaim, CaptureController, type CaptureControllerOptions, type CaptureKind, CaptureUnavailableError, ChunkReadable, type ClientToken, ClientTokenError, type ConsumingTransport, type CreateClientTokenOptions, type CreditBalance, type CreditLedgerEntry, CreditsClient, type CreditsClientOptions, CreditsError, type CreditsLedgerOptions, CreditsUnauthorizedError, DATA_CHANNEL_MESSAGE_CEILING, DEFAULT_DOC_SYNC_TIMEOUT_MS, DEFAULT_GATEWAY_URL, DEFAULT_PRODUCE_ACK_TIMEOUT_MS, DEFAULT_REFERENCE_JPEG_QUALITY, DEFAULT_REFERENCE_MAX_SIZE, DEFAULT_WHEN_LIVE_TIMEOUT_MS, DocTokenSupplier, FOCUS_FIELD, FOREGROUND_COALESCE_MS, FrameReassembler, GenerationTick, INPUT_PRESENCE_DEFAULT_HZ, INPUT_PRESENCE_FIELD, type InputPresenceAwareness, type InputPresencePublisher, type InputPresencePublisherOptions, type InputPresenceState, InvalidDurationError, LEGACY_ACTIVATION_HINT_PATH, type ListOptions, type ListResult, MediaSession, type NormalizeReferenceImageOptions, PLATFORM_DOC_NAME, PermanentLockedError, type PhaseObservable, PinRequiresActiveTempError, Presence, type PresenceAwarenessSink, type PresenceConnectivityState, type PresenceFocus, type PresenceInteractionKind, PresenceTracker, type PresenceTrackerOptions, type PresenceTransportLike, type PresenceVisibility, ProduceAckTimeoutError, type ReassembledFrame, type ReassemblerCallbacks, type ReassemblerOptions, Recording, RecordingNotFoundError, RecordingsAccessor, RecordingsClient, type RecordingsClientOptions, RecordingsError, RecordingsUnauthorizedError, type ReferenceImage, type ReferenceImageSource, type ReferenceImageType, RequestAbortError, RequestCancelledError, RequestDocSyncError, RequestError, RequestOptions, RequestStreamOptions, RequestTimeoutError, RetainNotTempError, type RetentionIntent, RuntimeArtifact, RuntimeArtifactDownload, RuntimeArtifactNotFoundError, RuntimeArtifactsAccessor, RuntimeArtifactsClient, type RuntimeArtifactsClientOptions, RuntimeArtifactsError, RuntimeArtifactsUnauthorizedError, Session, SessionAllocationError, SessionDiagnostic, SessionDirectory, SessionDirectoryError, SessionEndError, SessionEndResult, SessionEndUnavailableError, SessionFailedError, SessionFailureKind, Session$1 as SessionInterface, SessionPhase, SessionPhaseName, type SessionState, SessionStatsSample, SessionStatus, SessionStream$1 as SessionStream, type SessionSummary, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, TransportOfferResponse, TransportSessionMismatchError, TransportState, URUN_DEV_ENV, USER_ACTIVITY_FIELD, USER_ACTIVITY_MIN_INTERVAL_MS, type UserActivityPayload, VISIBILITY_FIELD, type VideoStreamOptions, WIRE_MESSAGE_BUDGET, WebRtcSession, WebTransportSession, type WhenLiveOptions, WtDataLaneSink, activationHintFrom, cameraCaptureAvailable, captureStillFromVideo, computeBackoffDelay, createActivityTracker, createCameraWarp, createClientToken, createCreditsClient, createInputPresencePublisher, createRecordingsClient, createRuntimeArtifactsClient, createStore, describeSessionFailure, describeSessionPhase, fitWithin, isDurationString, isPausedPhase, isRetryableSessionError, isWakingPhase, normalizeReferenceImage, normalizeRetention, observeLeaveConfirm, observePageLifecycle, observePageTeardown, referenceImageErrorMessage, sessionDirectory, sessionFailureFromMediaError, sharedCaptureController, videoStream, whenLive };