@urun-sh/core 0.3.6 → 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.
package/dist/index.d.mts CHANGED
@@ -1,8 +1,60 @@
1
- import { g as AppOptions, f as App$1, ae as SessionPhase, ak as SessionStatus, ag as SessionPhaseName, A as AccessTokenOptions, $ as RuntimeArtifact, a0 as RuntimeArtifactDownload, T as Recording, aA as TransportState, a8 as Session$1, C as ChannelEndpoint, ax as TransportSession, h as AttachOptions, a9 as SessionDiagnostic, b as ActivationEvent, aj as SessionStatsSample, z as GenerationTick, X as RecordingsAccessor, a1 as RuntimeArtifactsAccessor, ac as SessionEndResult, al as SessionStream$1, as as StreamDataTransport, ab as SessionDocumentImpl, ar as StreamChunkOptions, m as ChunkReadable, P as Presence, v as DocConnector, x as DocTokenSupplier, w as DocServerUrlResolver, Z as RequestOptions, _ as RequestStreamOptions, aq as StoreOptions, ap as Store, k as ChannelMultiplexer, ad as SessionFailureKind, H as MediaSession, aw as TransportOfferResponse, aF as WtAudioLaneSeam, aG as WtAudioUplinkSeam, aN as WtVideoUplinkSeam, aM as WtDataUplinkSender, aK as WtDataLaneSink } from './stream-data-DSwDgcFU.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, K as PresenceState, O as PrewakeOptions, Q as PrewakeResult, R as PrewakeStatus, S as QuicStreamDataTransport, U as RecordingBucket, V as RecordingLifecycle, W as RecordingStatus, Y as ReleaseSessionBeaconOptions, a2 as RuntimeAvailability, a3 as RuntimeWakeDetail, a4 as RuntimeWakeGolden, a5 as RuntimeWakeReasonCode, a6 as SIGNALING_PROTOCOL_VERSION, a7 as STREAM_END, aa as SessionDocument, af as SessionPhaseError, ai as SessionStatsOptions, am as SessionText, an as SignalCarrier, ao as Signaling, at as TransportEstablishedNotify, au as TransportNegotiator, av as TransportOfferRequest, az as TransportSessionSignaling, aB as VideoPlayoutOptions, aC as WT_CONTROL_FRAME_MAX, aD as WT_DATA_STREAM_VERSION, aE as WatchGenerationTickOptions, aH as WtControlDecoder, aI as WtControlMessage, aJ as WtDataEnvelope, aL as WtDataStreamParser, aP as consumeWtDataStreams, aS as decodeStreamEnvelope, aU as derivedLegName, aV as derivedLegRole, aW as encodeStreamEnvelope, aX as encodeWtControlFrame, aY as isPendingRecording, aZ as mediaRecorderChunkSource, a_ as parseDgramHeader, a$ as prewake, b0 as releaseSessionBeacon, b3 as watchGenerationTick, b4 as writeDgramHeader } from './stream-data-DSwDgcFU.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;
@@ -992,7 +1059,7 @@ interface CameraWarp {
992
1059
  }
993
1060
  declare function createCameraWarp(options?: CameraWarpOptions): CameraWarp;
994
1061
 
995
- declare class WebTransportSession implements MediaSession {
1062
+ declare class WebTransportSession implements MediaSession, PathHealthReporting {
996
1063
  private offer;
997
1064
  private sessionId;
998
1065
  private canvas;
@@ -1018,6 +1085,14 @@ declare class WebTransportSession implements MediaSession {
1018
1085
  private deadFired;
1019
1086
  private stopped;
1020
1087
  private feedbackTimer;
1088
+
1089
+ private closedReason;
1090
+
1091
+ private controlWriteError;
1092
+
1093
+ private controlWritesAccepted;
1094
+
1095
+ private gatewayPings;
1021
1096
  private reassembler;
1022
1097
  private lastArrivalTs;
1023
1098
  private jitterEwmaMs;
@@ -1061,6 +1136,10 @@ declare class WebTransportSession implements MediaSession {
1061
1136
  } | undefined);
1062
1137
 
1063
1138
  start(): Promise<void>;
1139
+
1140
+ pathLiveness(): PathLiveness;
1141
+
1142
+ fail(reason: string): void;
1064
1143
  stop(): Promise<void>;
1065
1144
 
1066
1145
  private datagramWriter;
@@ -1088,6 +1167,7 @@ declare class WebTransportSession implements MediaSession {
1088
1167
  private onUplinkSendError;
1089
1168
  private datagramLoop;
1090
1169
  private decodeFrame;
1170
+
1091
1171
  private sendControl;
1092
1172
  private readControl;
1093
1173
  private controlLoop;
@@ -1175,4 +1255,4 @@ declare class FrameReassembler {
1175
1255
  private requestKeyframe;
1176
1256
  }
1177
1257
 
1178
- 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 };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,60 @@
1
- import { g as AppOptions, f as App$1, ae as SessionPhase, ak as SessionStatus, ag as SessionPhaseName, A as AccessTokenOptions, $ as RuntimeArtifact, a0 as RuntimeArtifactDownload, T as Recording, aA as TransportState, a8 as Session$1, C as ChannelEndpoint, ax as TransportSession, h as AttachOptions, a9 as SessionDiagnostic, b as ActivationEvent, aj as SessionStatsSample, z as GenerationTick, X as RecordingsAccessor, a1 as RuntimeArtifactsAccessor, ac as SessionEndResult, al as SessionStream$1, as as StreamDataTransport, ab as SessionDocumentImpl, ar as StreamChunkOptions, m as ChunkReadable, P as Presence, v as DocConnector, x as DocTokenSupplier, w as DocServerUrlResolver, Z as RequestOptions, _ as RequestStreamOptions, aq as StoreOptions, ap as Store, k as ChannelMultiplexer, ad as SessionFailureKind, H as MediaSession, aw as TransportOfferResponse, aF as WtAudioLaneSeam, aG as WtAudioUplinkSeam, aN as WtVideoUplinkSeam, aM as WtDataUplinkSender, aK as WtDataLaneSink } from './stream-data-DSwDgcFU.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, K as PresenceState, O as PrewakeOptions, Q as PrewakeResult, R as PrewakeStatus, S as QuicStreamDataTransport, U as RecordingBucket, V as RecordingLifecycle, W as RecordingStatus, Y as ReleaseSessionBeaconOptions, a2 as RuntimeAvailability, a3 as RuntimeWakeDetail, a4 as RuntimeWakeGolden, a5 as RuntimeWakeReasonCode, a6 as SIGNALING_PROTOCOL_VERSION, a7 as STREAM_END, aa as SessionDocument, af as SessionPhaseError, ai as SessionStatsOptions, am as SessionText, an as SignalCarrier, ao as Signaling, at as TransportEstablishedNotify, au as TransportNegotiator, av as TransportOfferRequest, az as TransportSessionSignaling, aB as VideoPlayoutOptions, aC as WT_CONTROL_FRAME_MAX, aD as WT_DATA_STREAM_VERSION, aE as WatchGenerationTickOptions, aH as WtControlDecoder, aI as WtControlMessage, aJ as WtDataEnvelope, aL as WtDataStreamParser, aP as consumeWtDataStreams, aS as decodeStreamEnvelope, aU as derivedLegName, aV as derivedLegRole, aW as encodeStreamEnvelope, aX as encodeWtControlFrame, aY as isPendingRecording, aZ as mediaRecorderChunkSource, a_ as parseDgramHeader, a$ as prewake, b0 as releaseSessionBeacon, b3 as watchGenerationTick, b4 as writeDgramHeader } from './stream-data-DSwDgcFU.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;
@@ -992,7 +1059,7 @@ interface CameraWarp {
992
1059
  }
993
1060
  declare function createCameraWarp(options?: CameraWarpOptions): CameraWarp;
994
1061
 
995
- declare class WebTransportSession implements MediaSession {
1062
+ declare class WebTransportSession implements MediaSession, PathHealthReporting {
996
1063
  private offer;
997
1064
  private sessionId;
998
1065
  private canvas;
@@ -1018,6 +1085,14 @@ declare class WebTransportSession implements MediaSession {
1018
1085
  private deadFired;
1019
1086
  private stopped;
1020
1087
  private feedbackTimer;
1088
+
1089
+ private closedReason;
1090
+
1091
+ private controlWriteError;
1092
+
1093
+ private controlWritesAccepted;
1094
+
1095
+ private gatewayPings;
1021
1096
  private reassembler;
1022
1097
  private lastArrivalTs;
1023
1098
  private jitterEwmaMs;
@@ -1061,6 +1136,10 @@ declare class WebTransportSession implements MediaSession {
1061
1136
  } | undefined);
1062
1137
 
1063
1138
  start(): Promise<void>;
1139
+
1140
+ pathLiveness(): PathLiveness;
1141
+
1142
+ fail(reason: string): void;
1064
1143
  stop(): Promise<void>;
1065
1144
 
1066
1145
  private datagramWriter;
@@ -1088,6 +1167,7 @@ declare class WebTransportSession implements MediaSession {
1088
1167
  private onUplinkSendError;
1089
1168
  private datagramLoop;
1090
1169
  private decodeFrame;
1170
+
1091
1171
  private sendControl;
1092
1172
  private readControl;
1093
1173
  private controlLoop;
@@ -1175,4 +1255,4 @@ declare class FrameReassembler {
1175
1255
  private requestKeyframe;
1176
1256
  }
1177
1257
 
1178
- 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 };