@urun-sh/core 0.2.56 → 0.2.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { g as AppOptions, f as App$1, a1 as SessionPhase, a5 as SessionStatus, a3 as SessionPhaseName, A as AccessTokenOptions, O as RuntimeArtifact, Q as RuntimeArtifactDownload, R as Recording, X as Session$1, C as ChannelEndpoint, ac as TransportSession, h as AttachOptions, Y as SessionDiagnostic, b as ActivationEvent, I as RecordingsAccessor, S as RuntimeArtifactsAccessor, $ as SessionEndResult, a6 as SessionStream$1, ab as StreamDataTransport, _ as SessionDocumentImpl, aa as StreamChunkOptions, m as ChunkReadable, P as Presence, t as DocConnector, u as DocTokenSupplier, K as RequestOptions, N as RequestStreamOptions, a9 as StoreOptions, a8 as Store, k as ChannelMultiplexer, a0 as SessionFailureKind, ae as TransportState } from './stream-data-Cb0t-gV0.js';
2
- export { c as ActivationState, i as AudioPlayoutOptions, D as DERIVED_LEG_SEP, q as DerivedLegRole, s as DocConnectionState, M as MediaChunkBinding, v as MediaChunkSource, w as MediaChunkSourceFactory, x as MediaRecorderChunkSourceOptions, y as PresenceState, z as PrewakeOptions, B as PrewakeResult, E as PrewakeStatus, F as RecordingBucket, G as RecordingLifecycle, H as RecordingStatus, J as ReleaseSessionBeaconOptions, T as RuntimeAvailability, U as RuntimeWakeDetail, V as RuntimeWakeGolden, W as RuntimeWakeReasonCode, Z as SessionDocument, a2 as SessionPhaseError, a7 as SessionText, aj as derivedLegName, ak as derivedLegRole, al as isPendingRecording, am as mediaRecorderChunkSource, an as prewake, ao as releaseSessionBeacon } from './stream-data-Cb0t-gV0.js';
1
+ import { g as AppOptions, f as App$1, a2 as SessionPhase, a8 as SessionStatus, a4 as SessionPhaseName, A as AccessTokenOptions, Q as RuntimeArtifact, S as RuntimeArtifactDownload, R as Recording, Y as Session$1, C as ChannelEndpoint, af as TransportSession, h as AttachOptions, Z as SessionDiagnostic, b as ActivationEvent, a7 as SessionStatsSample, J as RecordingsAccessor, T as RuntimeArtifactsAccessor, a0 as SessionEndResult, a9 as SessionStream$1, ae as StreamDataTransport, $ as SessionDocumentImpl, ad as StreamChunkOptions, m as ChunkReadable, P as Presence, t as DocConnector, u as DocTokenSupplier, N as RequestOptions, O as RequestStreamOptions, ac as StoreOptions, ab as Store, k as ChannelMultiplexer, a1 as SessionFailureKind, ah as TransportState } from './stream-data-Cgh02-qs.js';
2
+ export { c as ActivationState, i as AudioPlayoutOptions, D as DERIVED_LEG_SEP, q as DerivedLegRole, s as DocConnectionState, I as InboundStatsSample, M as MediaChunkBinding, v as MediaChunkSource, w as MediaChunkSourceFactory, x as MediaRecorderChunkSourceOptions, y as PresenceState, z as PrewakeOptions, B as PrewakeResult, E as PrewakeStatus, F as RecordingBucket, G as RecordingLifecycle, H as RecordingStatus, K as ReleaseSessionBeaconOptions, U as RuntimeAvailability, V as RuntimeWakeDetail, W as RuntimeWakeGolden, X as RuntimeWakeReasonCode, _ as SessionDocument, a3 as SessionPhaseError, a6 as SessionStatsOptions, aa as SessionText, ai as VideoPlayoutOptions, an as derivedLegName, ao as derivedLegRole, ap as isPendingRecording, aq as mediaRecorderChunkSource, ar as prewake, as as releaseSessionBeacon } from './stream-data-Cgh02-qs.js';
3
3
  import 'yjs';
4
4
  import 'y-protocols/awareness';
5
5
 
@@ -317,6 +317,8 @@ declare class Session implements Session$1 {
317
317
 
318
318
  onActivation(handler: (event: ActivationEvent) => void): () => void;
319
319
 
320
+ onStats(handler: (sample: SessionStatsSample) => void): () => void;
321
+
320
322
  whenLive(options?: WhenLiveOptions): Promise<void>;
321
323
 
322
324
  get recordings(): RecordingsAccessor;
@@ -790,6 +792,61 @@ interface CameraWarp {
790
792
  }
791
793
  declare function createCameraWarp(options?: CameraWarpOptions): CameraWarp;
792
794
 
795
+ declare const WT_DATA_STREAM_VERSION = 1;
796
+
797
+ interface WtDataEnvelope {
798
+ name: string;
799
+ payload: unknown;
800
+ }
801
+
802
+ interface WtDataLaneSink {
803
+ onData(name: string, payload: unknown): void;
804
+ onLaneError(err: Error): void;
805
+ }
806
+
807
+ interface QuicStreamDataTransport {
808
+
809
+ markStreamDataLaneQuic(): void;
810
+
811
+ dispatchQuicStreamData(name: string, payload: unknown): void;
812
+
813
+ quicStreamDataLaneLost(reason: string): void;
814
+
815
+ raiseQuicStreamDataError(err: Error): void;
816
+ }
817
+
818
+ declare class WtDataStreamParser {
819
+ private buf;
820
+ private name;
821
+ private ended;
822
+
823
+ get streamName(): string | null;
824
+ push(chunk: Uint8Array): WtDataEnvelope[];
825
+
826
+ finish(): void;
827
+ }
828
+
829
+ interface WtByteReader {
830
+ read(): Promise<{
831
+ value?: Uint8Array;
832
+ done: boolean;
833
+ }>;
834
+ cancel?(reason?: unknown): Promise<void>;
835
+ }
836
+ interface WtIncomingUniStream {
837
+ getReader(): WtByteReader;
838
+ }
839
+ interface WtIncomingUniStreams {
840
+ getReader(): {
841
+ read(): Promise<{
842
+ value?: WtIncomingUniStream;
843
+ done: boolean;
844
+ }>;
845
+ };
846
+ }
847
+
848
+ declare function consumeWtDataStreams(incoming: WtIncomingUniStreams, sink: WtDataLaneSink): Promise<void>;
849
+
793
850
  interface MediaSession {
794
851
  readonly kind: 'webtransport' | 'webrtc';
795
852
  start(): Promise<void>;
@@ -804,6 +861,8 @@ interface MediaSession {
804
861
  };
805
862
 
806
863
  readonly firstMedia: Promise<void>;
864
+
865
+ consumeDataStreams?(sink: WtDataLaneSink): void;
807
866
  }
808
867
 
809
868
  interface Signaling {
@@ -837,6 +896,8 @@ interface TransportOfferRequest {
837
896
  webcodecs: boolean;
838
897
 
839
898
  codecs: string[];
899
+
900
+ wtData?: boolean;
840
901
  };
841
902
  }
842
903
  interface TransportOfferResponse {
@@ -852,6 +913,8 @@ interface TransportOfferResponse {
852
913
 
853
914
  token: string;
854
915
  codec: string;
916
+
917
+ data?: boolean;
855
918
  };
856
919
  }
857
920
  interface TransportEstablishedNotify {
@@ -905,6 +968,16 @@ declare function parseDgramHeader(view: DataView): DgramHeader;
905
968
 
906
969
  declare function writeDgramHeader(h: DgramHeader): Uint8Array;
907
970
 
971
+ interface NegotiatorDataLaneSeam {
972
+
973
+ onData(name: string, payload: unknown): void;
974
+
975
+ onQuicLane(): void;
976
+
977
+ onQuicLaneLost(reason: string): void;
978
+
979
+ onLaneError(err: Error): void;
980
+ }
908
981
  interface NegotiatorOptions {
909
982
 
910
983
  quicDeadlineMs?: number;
@@ -916,6 +989,8 @@ interface NegotiatorOptions {
916
989
 
917
990
  createWebRtcSession: () => MediaSession;
918
991
  createWebTransportSession?: (offer: NonNullable<TransportOfferResponse['webtransport']>) => MediaSession;
992
+
993
+ dataLane?: NegotiatorDataLaneSeam;
919
994
  }
920
995
  declare class TransportNegotiator {
921
996
  private signaling;
@@ -923,12 +998,16 @@ declare class TransportNegotiator {
923
998
  private opts;
924
999
  private session;
925
1000
  private offer;
1001
+
1002
+ private quicDataLane;
926
1003
  constructor(signaling: Signaling, sessionId: string, opts: NegotiatorOptions);
927
1004
  get activeTransport(): MediaSession['kind'] | null;
928
1005
  connect(): Promise<MediaSession>;
929
1006
  disconnect(): Promise<void>;
930
1007
 
931
1008
  retryWebTransport(): Promise<MediaSession | null>;
1009
+
1010
+ private engageQuicDataLane;
932
1011
  private createWebTransportSession;
933
1012
  private startWebRtc;
934
1013
 
@@ -956,6 +1035,8 @@ declare class WebTransportSession implements MediaSession {
956
1035
  private lastArrivalTs;
957
1036
  private jitterEwmaMs;
958
1037
  private lastStats;
1038
+
1039
+ private dataLaneSink;
959
1040
  private firstFrameResolve;
960
1041
  private firstFrameReject;
961
1042
 
@@ -973,6 +1054,8 @@ declare class WebTransportSession implements MediaSession {
973
1054
  lossPct: number;
974
1055
  jitterMs: number;
975
1056
  };
1057
+
1058
+ consumeDataStreams(sink: WtDataLaneSink): void;
976
1059
  private initDecoder;
977
1060
 
978
1061
  private onDecoderError;
@@ -1063,4 +1146,4 @@ declare class FrameReassembler {
1063
1146
  private requestKeyframe;
1064
1147
  }
1065
1148
 
1066
- 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, 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, DGRAM_HEADER_BYTES, type DgramHeader, DocTokenSupplier, FOREGROUND_COALESCE_MS, FrameReassembler, INPUT_PRESENCE_DEFAULT_HZ, INPUT_PRESENCE_FIELD, type InputPresenceAwareness, type InputPresencePublisher, type InputPresencePublisherOptions, type InputPresenceState, InvalidDurationError, LEGACY_ACTIVATION_HINT_PATH, type MediaSession, type NegotiatorOptions, type NormalizeReferenceImageOptions, PLATFORM_DOC_NAME, PermanentLockedError, type PhaseObservable, PinRequiresActiveTempError, Presence, 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, SessionStatus, SessionStream$1 as SessionStream, type SignalCarrier, type Signaling, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, type TransportEstablishedNotify, TransportNegotiator, type TransportOfferRequest, type TransportOfferResponse, TransportSessionMismatchError, TransportSessionSignaling, TransportState, URUN_DEV_ENV, VISIBILITY_FIELD, type VideoStreamOptions, WIRE_MESSAGE_BUDGET, WT_CONTROL_FRAME_MAX, WebRtcSession, WebTransportSession, type WhenLiveOptions, WtControlDecoder, type WtControlMessage, activationHintFrom, cameraCaptureAvailable, captureStillFromVideo, computeBackoffDelay, createActivityTracker, createCameraWarp, createClientToken, createInputPresencePublisher, createRecordingsClient, createRuntimeArtifactsClient, createStore, describeSessionFailure, describeSessionPhase, encodeWtControlFrame, fitWithin, isDurationString, isRetryableSessionError, isWakingPhase, normalizeReferenceImage, normalizeRetention, observeLeaveConfirm, observePageLifecycle, observePageTeardown, parseDgramHeader, referenceImageErrorMessage, sessionFailureFromMediaError, sharedCaptureController, videoStream, whenLive, writeDgramHeader };
1149
+ 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, 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, DGRAM_HEADER_BYTES, type DgramHeader, DocTokenSupplier, FOREGROUND_COALESCE_MS, FrameReassembler, INPUT_PRESENCE_DEFAULT_HZ, INPUT_PRESENCE_FIELD, type InputPresenceAwareness, type InputPresencePublisher, type InputPresencePublisherOptions, type InputPresenceState, InvalidDurationError, LEGACY_ACTIVATION_HINT_PATH, type MediaSession, type NegotiatorDataLaneSeam, type NegotiatorOptions, type NormalizeReferenceImageOptions, PLATFORM_DOC_NAME, PermanentLockedError, type PhaseObservable, PinRequiresActiveTempError, Presence, ProduceAckTimeoutError, type QuicStreamDataTransport, 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, type SignalCarrier, type Signaling, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, type TransportEstablishedNotify, TransportNegotiator, type TransportOfferRequest, type TransportOfferResponse, TransportSessionMismatchError, TransportSessionSignaling, TransportState, URUN_DEV_ENV, VISIBILITY_FIELD, type VideoStreamOptions, WIRE_MESSAGE_BUDGET, WT_CONTROL_FRAME_MAX, WT_DATA_STREAM_VERSION, WebRtcSession, WebTransportSession, type WhenLiveOptions, WtControlDecoder, type WtControlMessage, type WtDataEnvelope, type WtDataLaneSink, WtDataStreamParser, activationHintFrom, cameraCaptureAvailable, captureStillFromVideo, computeBackoffDelay, consumeWtDataStreams, createActivityTracker, createCameraWarp, createClientToken, createInputPresencePublisher, createRecordingsClient, createRuntimeArtifactsClient, createStore, describeSessionFailure, describeSessionPhase, encodeWtControlFrame, fitWithin, isDurationString, isRetryableSessionError, isWakingPhase, normalizeReferenceImage, normalizeRetention, observeLeaveConfirm, observePageLifecycle, observePageTeardown, parseDgramHeader, referenceImageErrorMessage, sessionFailureFromMediaError, sharedCaptureController, videoStream, whenLive, writeDgramHeader };