@urun-sh/core 0.2.14 → 0.2.16
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/{chunk-ESLF63FX.mjs → chunk-AEIZ6XUT.mjs} +2 -2
- package/dist/{chunk-SHMKV7WG.mjs → chunk-GKS24GDI.mjs} +5 -5
- package/dist/index.browser.d.mts +268 -3
- package/dist/index.browser.d.ts +268 -3
- package/dist/index.browser.js +2 -2
- package/dist/index.browser.mjs +1 -1
- package/dist/index.d.mts +268 -3
- package/dist/index.d.ts +268 -3
- package/dist/index.js +5 -5
- package/dist/index.mjs +1 -1
- package/dist/internal.browser.d.mts +1 -1
- package/dist/internal.browser.d.ts +1 -1
- package/dist/internal.browser.js +2 -2
- package/dist/internal.browser.mjs +1 -1
- package/dist/internal.d.mts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +5 -5
- package/dist/internal.mjs +1 -1
- package/dist/{stream-data-GIyoXg7t.d.mts → stream-data-D8AOc7CR.d.mts} +7 -1
- package/dist/{stream-data-GIyoXg7t.d.ts → stream-data-D8AOc7CR.d.ts} +7 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as AppOptions, a as App$1, K as SessionPhase, T as SessionStatus, O 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, U as SessionStream$1, Z as StreamDataTransport, I as SessionDocumentImpl, Y as StreamChunkOptions, g as ChunkReadable, P as Presence, k as DocConnector, w as RequestOptions, x as RequestStreamOptions, X as StoreOptions, W as Store, e as ChannelMultiplexer, J as SessionFailureKind } from './stream-data-
|
|
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, N as SessionPhaseError, V as SessionText,
|
|
1
|
+
import { b as AppOptions, a as App$1, K as SessionPhase, T as SessionStatus, O 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, U as SessionStream$1, Z as StreamDataTransport, I as SessionDocumentImpl, Y as StreamChunkOptions, g as ChunkReadable, P as Presence, k as DocConnector, w as RequestOptions, x as RequestStreamOptions, X as StoreOptions, W as Store, e as ChannelMultiplexer, J as SessionFailureKind, a0 as TransportState } from './stream-data-D8AOc7CR.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, N as SessionPhaseError, V as SessionText, a4 as isPendingRecording, a5 as mediaRecorderChunkSource } from './stream-data-D8AOc7CR.js';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
import 'y-protocols/awareness';
|
|
5
5
|
|
|
@@ -375,6 +375,21 @@ declare class StreamDirectionConflict extends Error {
|
|
|
375
375
|
constructor(stream: string, owner: 'runtime' | 'browser', attempted: 'runtime' | 'browser');
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
+
declare const DEFAULT_PRODUCE_ACK_TIMEOUT_MS = 15000;
|
|
379
|
+
|
|
380
|
+
declare class ProduceAckTimeoutError extends Error {
|
|
381
|
+
|
|
382
|
+
readonly kind: 'audio' | 'video';
|
|
383
|
+
|
|
384
|
+
readonly stream: string;
|
|
385
|
+
|
|
386
|
+
readonly timeoutMs: number;
|
|
387
|
+
constructor(kind: 'audio' | 'video', options?: {
|
|
388
|
+
stream?: string;
|
|
389
|
+
timeoutMs?: number;
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
|
|
378
393
|
declare class RequestAbortError extends RequestError {
|
|
379
394
|
constructor(requestId?: string);
|
|
380
395
|
}
|
|
@@ -533,4 +548,254 @@ interface InputPresencePublisher {
|
|
|
533
548
|
|
|
534
549
|
declare function createInputPresencePublisher(options: InputPresencePublisherOptions): InputPresencePublisher;
|
|
535
550
|
|
|
536
|
-
|
|
551
|
+
interface MediaSession {
|
|
552
|
+
readonly kind: 'webtransport' | 'webrtc';
|
|
553
|
+
start(): Promise<void>;
|
|
554
|
+
stop(): Promise<void>;
|
|
555
|
+
|
|
556
|
+
onDead(cb: (reason: string) => void): void;
|
|
557
|
+
|
|
558
|
+
stats(): {
|
|
559
|
+
recvBps: number;
|
|
560
|
+
lossPct: number;
|
|
561
|
+
jitterMs: number;
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
interface Signaling {
|
|
566
|
+
request<T = unknown>(method: string, params?: unknown): Promise<T>;
|
|
567
|
+
notify(method: string, params?: unknown): void;
|
|
568
|
+
|
|
569
|
+
on(method: string, handler: (params: Record<string, unknown>) => void): () => void;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
interface SignalCarrier {
|
|
573
|
+
|
|
574
|
+
sendSignal(msg: Record<string, unknown>): void;
|
|
575
|
+
|
|
576
|
+
onSignal(handler: (msg: Record<string, unknown>) => void): () => void;
|
|
577
|
+
}
|
|
578
|
+
declare class TransportSessionSignaling implements Signaling {
|
|
579
|
+
private carrier;
|
|
580
|
+
private requestTimeoutMs;
|
|
581
|
+
constructor(carrier: SignalCarrier, requestTimeoutMs?: number);
|
|
582
|
+
request<T = unknown>(method: string, params?: unknown): Promise<T>;
|
|
583
|
+
notify(method: string, params?: unknown): void;
|
|
584
|
+
on(method: string, handler: (params: Record<string, unknown>) => void): () => void;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
interface TransportOfferRequest {
|
|
588
|
+
sessionId: string;
|
|
589
|
+
capabilities: {
|
|
590
|
+
|
|
591
|
+
webtransport: boolean;
|
|
592
|
+
|
|
593
|
+
webcodecs: boolean;
|
|
594
|
+
|
|
595
|
+
codecs: string[];
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
interface TransportOfferResponse {
|
|
599
|
+
|
|
600
|
+
webrtc: {
|
|
601
|
+
routerRtpCapabilities: unknown;
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
webtransport?: {
|
|
605
|
+
url: string;
|
|
606
|
+
|
|
607
|
+
certHashes: string[];
|
|
608
|
+
|
|
609
|
+
token: string;
|
|
610
|
+
codec: string;
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
interface TransportEstablishedNotify {
|
|
614
|
+
sessionId: string;
|
|
615
|
+
transport: 'webtransport' | 'webrtc';
|
|
616
|
+
|
|
617
|
+
fallbackReason?: string;
|
|
618
|
+
}
|
|
619
|
+
type WtControlMessage = {
|
|
620
|
+
t: 'hello';
|
|
621
|
+
token: string;
|
|
622
|
+
sessionId: string;
|
|
623
|
+
} | {
|
|
624
|
+
t: 'hello-ack';
|
|
625
|
+
codec: string;
|
|
626
|
+
width: number;
|
|
627
|
+
height: number;
|
|
628
|
+
} | {
|
|
629
|
+
t: 'ping';
|
|
630
|
+
ts: number;
|
|
631
|
+
} | {
|
|
632
|
+
t: 'pong';
|
|
633
|
+
ts: number;
|
|
634
|
+
} | {
|
|
635
|
+
t: 'keyframe-request';
|
|
636
|
+
} | {
|
|
637
|
+
t: 'feedback';
|
|
638
|
+
recvBps: number;
|
|
639
|
+
lossPct: number;
|
|
640
|
+
jitterMs: number;
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
declare const WT_CONTROL_FRAME_MAX: number;
|
|
644
|
+
|
|
645
|
+
declare function encodeWtControlFrame(msg: WtControlMessage): Uint8Array;
|
|
646
|
+
|
|
647
|
+
declare class WtControlDecoder {
|
|
648
|
+
private buf;
|
|
649
|
+
push(bytes: Uint8Array): WtControlMessage[];
|
|
650
|
+
}
|
|
651
|
+
declare const DGRAM_HEADER_BYTES = 12;
|
|
652
|
+
interface DgramHeader {
|
|
653
|
+
groupId: number;
|
|
654
|
+
frameSeq: number;
|
|
655
|
+
keyframe: boolean;
|
|
656
|
+
fragIndex: number;
|
|
657
|
+
fragCount: number;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
declare function parseDgramHeader(view: DataView): DgramHeader;
|
|
661
|
+
|
|
662
|
+
declare function writeDgramHeader(h: DgramHeader): Uint8Array;
|
|
663
|
+
|
|
664
|
+
interface NegotiatorOptions {
|
|
665
|
+
|
|
666
|
+
quicDeadlineMs?: number;
|
|
667
|
+
|
|
668
|
+
allowWebTransport?: boolean;
|
|
669
|
+
onTransportChange?: (kind: MediaSession['kind'], reason?: string) => void;
|
|
670
|
+
|
|
671
|
+
canvas?: HTMLCanvasElement;
|
|
672
|
+
|
|
673
|
+
createWebRtcSession: () => MediaSession;
|
|
674
|
+
createWebTransportSession?: (offer: NonNullable<TransportOfferResponse['webtransport']>) => MediaSession;
|
|
675
|
+
}
|
|
676
|
+
declare class TransportNegotiator {
|
|
677
|
+
private signaling;
|
|
678
|
+
private sessionId;
|
|
679
|
+
private opts;
|
|
680
|
+
private session;
|
|
681
|
+
private offer;
|
|
682
|
+
constructor(signaling: Signaling, sessionId: string, opts: NegotiatorOptions);
|
|
683
|
+
get activeTransport(): MediaSession['kind'] | null;
|
|
684
|
+
connect(): Promise<MediaSession>;
|
|
685
|
+
disconnect(): Promise<void>;
|
|
686
|
+
private createWebTransportSession;
|
|
687
|
+
private startWebRtc;
|
|
688
|
+
|
|
689
|
+
private armFailover;
|
|
690
|
+
private notifyEstablished;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
declare class WebTransportSession implements MediaSession {
|
|
694
|
+
private offer;
|
|
695
|
+
private sessionId;
|
|
696
|
+
private canvas;
|
|
697
|
+
readonly kind: "webtransport";
|
|
698
|
+
private wt;
|
|
699
|
+
private decoder;
|
|
700
|
+
private writer;
|
|
701
|
+
private deadCb;
|
|
702
|
+
private deadFired;
|
|
703
|
+
private stopped;
|
|
704
|
+
private feedbackTimer;
|
|
705
|
+
private reassembler;
|
|
706
|
+
private lastArrivalTs;
|
|
707
|
+
private jitterEwmaMs;
|
|
708
|
+
private lastStats;
|
|
709
|
+
private firstFrameResolve;
|
|
710
|
+
private firstFrameReject;
|
|
711
|
+
constructor(offer: NonNullable<TransportOfferResponse['webtransport']>, sessionId: string, canvas: HTMLCanvasElement);
|
|
712
|
+
|
|
713
|
+
start(): Promise<void>;
|
|
714
|
+
stop(): Promise<void>;
|
|
715
|
+
onDead(cb: (reason: string) => void): void;
|
|
716
|
+
stats(): {
|
|
717
|
+
recvBps: number;
|
|
718
|
+
lossPct: number;
|
|
719
|
+
jitterMs: number;
|
|
720
|
+
};
|
|
721
|
+
private initDecoder;
|
|
722
|
+
private datagramLoop;
|
|
723
|
+
private decodeFrame;
|
|
724
|
+
private sendControl;
|
|
725
|
+
private readControl;
|
|
726
|
+
private controlLoop;
|
|
727
|
+
|
|
728
|
+
private feedbackLoop;
|
|
729
|
+
private die;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
interface ConsumingTransport {
|
|
733
|
+
getTrackByName(name: string): MediaStreamTrack | undefined;
|
|
734
|
+
on(event: 'track', handler: (track: MediaStreamTrack) => void): () => void;
|
|
735
|
+
on(event: 'stateChange', handler: (state: TransportState) => void): () => void;
|
|
736
|
+
}
|
|
737
|
+
declare class WebRtcSession implements MediaSession {
|
|
738
|
+
private transport;
|
|
739
|
+
private streamName;
|
|
740
|
+
readonly kind: "webrtc";
|
|
741
|
+
private deadCb;
|
|
742
|
+
private deadFired;
|
|
743
|
+
private unsubscribers;
|
|
744
|
+
constructor(transport: ConsumingTransport, streamName?: string);
|
|
745
|
+
|
|
746
|
+
start(): Promise<void>;
|
|
747
|
+
|
|
748
|
+
stop(): Promise<void>;
|
|
749
|
+
onDead(cb: (reason: string) => void): void;
|
|
750
|
+
stats(): {
|
|
751
|
+
recvBps: number;
|
|
752
|
+
lossPct: number;
|
|
753
|
+
jitterMs: number;
|
|
754
|
+
};
|
|
755
|
+
private die;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
interface ReassembledFrame {
|
|
759
|
+
seq: number;
|
|
760
|
+
groupId: number;
|
|
761
|
+
keyframe: boolean;
|
|
762
|
+
data: Uint8Array;
|
|
763
|
+
}
|
|
764
|
+
interface ReassemblerCallbacks {
|
|
765
|
+
|
|
766
|
+
onFrame(frame: ReassembledFrame): void;
|
|
767
|
+
|
|
768
|
+
onKeyframeNeeded(): void;
|
|
769
|
+
}
|
|
770
|
+
interface ReassemblerOptions {
|
|
771
|
+
|
|
772
|
+
now?: () => number;
|
|
773
|
+
|
|
774
|
+
keyframeRequestDebounceMs?: number;
|
|
775
|
+
}
|
|
776
|
+
declare class FrameReassembler {
|
|
777
|
+
private cb;
|
|
778
|
+
private pending;
|
|
779
|
+
private newestGroupSeen;
|
|
780
|
+
private newestFrameDelivered;
|
|
781
|
+
private needKeyframe;
|
|
782
|
+
private kfRequestedAt;
|
|
783
|
+
private now;
|
|
784
|
+
private debounceMs;
|
|
785
|
+
private bytesInWindow;
|
|
786
|
+
private framesDelivered;
|
|
787
|
+
private framesAbandoned;
|
|
788
|
+
constructor(cb: ReassemblerCallbacks, opts?: ReassemblerOptions);
|
|
789
|
+
|
|
790
|
+
push(chunk: Uint8Array): void;
|
|
791
|
+
|
|
792
|
+
drainWindow(): {
|
|
793
|
+
bytes: number;
|
|
794
|
+
delivered: number;
|
|
795
|
+
abandoned: number;
|
|
796
|
+
};
|
|
797
|
+
private deliver;
|
|
798
|
+
private requestKeyframe;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
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, 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 };
|