@urun-sh/core 0.2.46 → 0.2.48
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/CHANGELOG.md +45 -0
- package/dist/chunk-BQIH7RYF.mjs +8 -0
- package/dist/chunk-PQCL4SUQ.mjs +3 -0
- package/dist/index.browser.d.mts +4 -4
- package/dist/index.browser.d.ts +4 -4
- package/dist/index.browser.js +2 -2
- package/dist/index.browser.mjs +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- 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-a_RrPi2p.d.mts → stream-data-TWBl_kh7.d.mts} +66 -25
- package/dist/{stream-data-a_RrPi2p.d.ts → stream-data-TWBl_kh7.d.ts} +66 -25
- package/package.json +1 -1
- package/dist/chunk-DUCJ3UFC.mjs +0 -8
- package/dist/chunk-OXPELTWD.mjs +0 -3
package/dist/internal.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __urunCreateRequire } from 'node:module'; const require = globalThis.require ?? __urunCreateRequire(import.meta.url);
|
|
2
|
-
import{E as r,H as t,I as
|
|
2
|
+
import{E as r,H as t,I as n,J as a,L as s,M as p,N as m,R as c,S as i,T as l,U as S,V as f,W as x,X as C,a as e,b as o}from"./chunk-BQIH7RYF.mjs";export{e as ChannelMultiplexer,i as DOC_SYNC_WIRE_CONTRACT_VERSION,o as DeferredChannelMultiplexer,f as DeferredDocConnector,s as LoopbackStreamData,x as SessionDocumentImpl,c as TransportSession,r as allocateSession,C as createPresence,S as createWebsocketDocConnector,l as deriveYjsServerUrl,a as ensureNodeWebRTC,t as isNodeRuntime,n as nodeMediasoupHandlerName,m as streamDataLabel,p as transportStreamData};
|
|
@@ -35,6 +35,19 @@ declare function mediaRecorderChunkSource(binding: MediaChunkBinding, options?:
|
|
|
35
35
|
|
|
36
36
|
declare const DOC_SYNC_WIRE_CONTRACT_VERSION = 1;
|
|
37
37
|
|
|
38
|
+
interface DocConnectionState {
|
|
39
|
+
|
|
40
|
+
connected: boolean;
|
|
41
|
+
|
|
42
|
+
consecutiveFailures: number;
|
|
43
|
+
|
|
44
|
+
lastCloseCode: number | null;
|
|
45
|
+
|
|
46
|
+
lastCloseReason: string | null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
type DocTokenSupplier = () => string | undefined | Promise<string | undefined>;
|
|
50
|
+
|
|
38
51
|
interface DocConnection {
|
|
39
52
|
|
|
40
53
|
readonly awareness: Awareness;
|
|
@@ -45,6 +58,8 @@ interface DocConnection {
|
|
|
45
58
|
|
|
46
59
|
ensureConnected?(): void;
|
|
47
60
|
|
|
61
|
+
onConnectionState?(handler: (state: DocConnectionState) => void): () => void;
|
|
62
|
+
|
|
48
63
|
destroy(): void;
|
|
49
64
|
}
|
|
50
65
|
|
|
@@ -58,9 +73,13 @@ interface WebsocketDocConnectorOptions {
|
|
|
58
73
|
|
|
59
74
|
sessionId: string;
|
|
60
75
|
|
|
61
|
-
token?: string;
|
|
76
|
+
token?: string | DocTokenSupplier;
|
|
62
77
|
|
|
63
78
|
WebSocketPolyfill?: typeof WebSocket;
|
|
79
|
+
|
|
80
|
+
maxBackoffTimeMs?: number;
|
|
81
|
+
|
|
82
|
+
dialTimeoutMs?: number;
|
|
64
83
|
}
|
|
65
84
|
|
|
66
85
|
declare function createWebsocketDocConnector(opts: WebsocketDocConnectorOptions): DocConnector;
|
|
@@ -104,8 +123,39 @@ interface RuntimeAvailability {
|
|
|
104
123
|
state: 'unavailable' | 'starting' | 'busy';
|
|
105
124
|
|
|
106
125
|
reason?: string;
|
|
126
|
+
|
|
127
|
+
wake?: RuntimeWakeDetail;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
type RuntimeWakeReasonCode = 'capture-attested' | 'no-portable-golden' | 'portable-golden-release-mismatch' | 'portable-golden-attestation-invalid';
|
|
131
|
+
|
|
132
|
+
interface RuntimeWakeGolden {
|
|
133
|
+
snapshotId: string;
|
|
134
|
+
snapshotCompatKey: string;
|
|
135
|
+
artifactSizeBytes: number;
|
|
136
|
+
durableArenaBytes: number;
|
|
137
|
+
volatileArenaBytes: 0;
|
|
138
|
+
uncoveredWeightBytes: number;
|
|
139
|
+
}
|
|
140
|
+
interface RuntimeWakeDetailBase {
|
|
141
|
+
schema: 'urun.runtime.wake.v1';
|
|
142
|
+
expectationBasis: 'snapshot-registry';
|
|
143
|
+
restoreObservation: 'not-observed';
|
|
107
144
|
}
|
|
108
145
|
|
|
146
|
+
type RuntimeWakeDetail = (RuntimeWakeDetailBase & {
|
|
147
|
+
portability: 'portable';
|
|
148
|
+
expectedWakePath: 'portable-golden-restore';
|
|
149
|
+
reasonCode: 'capture-attested';
|
|
150
|
+
golden: RuntimeWakeGolden;
|
|
151
|
+
}) | (RuntimeWakeDetailBase & {
|
|
152
|
+
portability: 'none';
|
|
153
|
+
expectedWakePath: 'cold-boot';
|
|
154
|
+
reasonCode: Exclude<RuntimeWakeReasonCode, 'capture-attested'>;
|
|
155
|
+
|
|
156
|
+
golden?: never;
|
|
157
|
+
});
|
|
158
|
+
|
|
109
159
|
type SessionFailureKind = 'create-failed' | 'never-live' | 'transport-failed' | 'media-permission' | 'ended' | 'runtime-failed' | 'expired' | 'produce-timeout';
|
|
110
160
|
|
|
111
161
|
interface SessionPhaseError {
|
|
@@ -278,6 +328,8 @@ interface SessionDocument {
|
|
|
278
328
|
readonly synced: boolean;
|
|
279
329
|
|
|
280
330
|
onSynced(handler: () => void): () => void;
|
|
331
|
+
|
|
332
|
+
onConnectionState?(handler: (state: DocConnectionState) => void): () => void;
|
|
281
333
|
}
|
|
282
334
|
|
|
283
335
|
interface SessionStream {
|
|
@@ -527,6 +579,8 @@ interface SessionGatewayResponse {
|
|
|
527
579
|
|
|
528
580
|
runtime_reason?: string;
|
|
529
581
|
|
|
582
|
+
runtime_wake?: unknown;
|
|
583
|
+
|
|
530
584
|
ends_at?: string;
|
|
531
585
|
error_code?: string;
|
|
532
586
|
error_message?: string;
|
|
@@ -748,28 +802,12 @@ declare class TransportSession {
|
|
|
748
802
|
|
|
749
803
|
private _wakingSince;
|
|
750
804
|
|
|
751
|
-
private
|
|
752
|
-
|
|
753
|
-
private _lastInboundTotal;
|
|
754
|
-
|
|
755
|
-
private _mediaEverFlowed;
|
|
756
|
-
|
|
757
|
-
private _lastInboundAdvanceAt;
|
|
805
|
+
private _mediaProbeTimer;
|
|
758
806
|
|
|
759
|
-
private
|
|
760
|
-
|
|
761
|
-
private _decodeSignalSeen;
|
|
762
|
-
|
|
763
|
-
private _lastFramesDecoded;
|
|
764
|
-
|
|
765
|
-
private _lastDecodeAdvanceAt;
|
|
807
|
+
private _joinProbes;
|
|
766
808
|
|
|
767
809
|
private _decodeDeathHandled;
|
|
768
810
|
|
|
769
|
-
private _latestInboundSample;
|
|
770
|
-
|
|
771
|
-
private _decodeWindowStartSample;
|
|
772
|
-
|
|
773
811
|
private _selectedCandidatePair;
|
|
774
812
|
|
|
775
813
|
private _candidatePairDiagnosticEmitted;
|
|
@@ -902,13 +940,14 @@ declare class TransportSession {
|
|
|
902
940
|
|
|
903
941
|
private _closeConsumersByProducer;
|
|
904
942
|
private _mediaPollMs;
|
|
905
|
-
private _mediaStallTimeoutMs;
|
|
906
943
|
|
|
907
|
-
private
|
|
908
|
-
|
|
909
|
-
private
|
|
944
|
+
private _firstFrameWindowMs;
|
|
945
|
+
|
|
946
|
+
private _startMediaProbe;
|
|
947
|
+
private _stopMediaProbe;
|
|
910
948
|
|
|
911
|
-
private
|
|
949
|
+
private _resetJoinProbes;
|
|
950
|
+
private _sampleMediaArrival;
|
|
912
951
|
|
|
913
952
|
private _renegotiate;
|
|
914
953
|
|
|
@@ -974,6 +1013,8 @@ declare class SessionDocumentImpl implements SessionDocument {
|
|
|
974
1013
|
|
|
975
1014
|
ensureConnected(): void;
|
|
976
1015
|
|
|
1016
|
+
onConnectionState(handler: (state: DocConnectionState) => void): () => void;
|
|
1017
|
+
|
|
977
1018
|
onSynced(handler: () => void): () => void;
|
|
978
1019
|
|
|
979
1020
|
set(patch: Record<string, unknown>): void;
|
|
@@ -1032,4 +1073,4 @@ interface DataChannelTransport {
|
|
|
1032
1073
|
|
|
1033
1074
|
declare function transportStreamData(transport: DataChannelTransport): StreamDataTransport;
|
|
1034
1075
|
|
|
1035
|
-
export { type
|
|
1076
|
+
export { type SessionFailureKind as $, type AccessTokenOptions$1 as A, type PrewakeStatus as B, type ChannelEndpoint as C, DERIVED_LEG_SEP as D, type RecordingBucket as E, type RecordingLifecycle as F, type RecordingStatus as G, type RecordingsAccessor as H, type ReleaseSessionBeaconOptions as I, type RequestOptions as J, type RequestStreamOptions as K, LoopbackStreamData as L, type MediaChunkBinding as M, type RuntimeArtifact as N, type RuntimeArtifactDownload as O, type Presence as P, type RuntimeArtifactsAccessor as Q, type Recording as R, type RuntimeAvailability as S, type RuntimeWakeDetail as T, type RuntimeWakeGolden as U, type RuntimeWakeReasonCode as V, type Session as W, type SessionDiagnostic as X, type SessionDocument as Y, SessionDocumentImpl as Z, type SessionEndResult as _, type AccessTokenOptions as a, type SessionPhase as a0, type SessionPhaseError as a1, type SessionPhaseName as a2, type SessionStartOptions as a3, type SessionStatus as a4, type SessionStream as a5, type SessionText as a6, type Store as a7, type StoreOptions as a8, type StreamChunkOptions as a9, type StreamDataTransport as aa, TransportSession as ab, type TransportSessionOptions as ac, type TransportState as ad, allocateSession as ae, createPresence as af, createWebsocketDocConnector as ag, deriveYjsServerUrl as ah, derivedLegName as ai, derivedLegRole as aj, isPendingRecording as ak, mediaRecorderChunkSource as al, prewake as am, releaseSessionBeacon as an, streamDataLabel as ao, transportStreamData as ap, type ActivationEvent as b, type ActivationState as c, type AllocateSessionOptions as d, type AllocatedSession as e, type App as f, type AppOptions as g, type AttachOptions as h, type ChannelMessage as i, ChannelMultiplexer as j, type ChannelName as k, type ChunkReadable as l, DOC_SYNC_WIRE_CONTRACT_VERSION as m, DeferredChannelMultiplexer as n, DeferredDocConnector as o, type DerivedLegRole as p, type DocConnection as q, type DocConnectionState as r, type DocConnector as s, type DocTokenSupplier as t, type MediaChunkSource as u, type MediaChunkSourceFactory as v, type MediaRecorderChunkSourceOptions as w, type PresenceState as x, type PrewakeOptions as y, type PrewakeResult as z };
|
|
@@ -35,6 +35,19 @@ declare function mediaRecorderChunkSource(binding: MediaChunkBinding, options?:
|
|
|
35
35
|
|
|
36
36
|
declare const DOC_SYNC_WIRE_CONTRACT_VERSION = 1;
|
|
37
37
|
|
|
38
|
+
interface DocConnectionState {
|
|
39
|
+
|
|
40
|
+
connected: boolean;
|
|
41
|
+
|
|
42
|
+
consecutiveFailures: number;
|
|
43
|
+
|
|
44
|
+
lastCloseCode: number | null;
|
|
45
|
+
|
|
46
|
+
lastCloseReason: string | null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
type DocTokenSupplier = () => string | undefined | Promise<string | undefined>;
|
|
50
|
+
|
|
38
51
|
interface DocConnection {
|
|
39
52
|
|
|
40
53
|
readonly awareness: Awareness;
|
|
@@ -45,6 +58,8 @@ interface DocConnection {
|
|
|
45
58
|
|
|
46
59
|
ensureConnected?(): void;
|
|
47
60
|
|
|
61
|
+
onConnectionState?(handler: (state: DocConnectionState) => void): () => void;
|
|
62
|
+
|
|
48
63
|
destroy(): void;
|
|
49
64
|
}
|
|
50
65
|
|
|
@@ -58,9 +73,13 @@ interface WebsocketDocConnectorOptions {
|
|
|
58
73
|
|
|
59
74
|
sessionId: string;
|
|
60
75
|
|
|
61
|
-
token?: string;
|
|
76
|
+
token?: string | DocTokenSupplier;
|
|
62
77
|
|
|
63
78
|
WebSocketPolyfill?: typeof WebSocket;
|
|
79
|
+
|
|
80
|
+
maxBackoffTimeMs?: number;
|
|
81
|
+
|
|
82
|
+
dialTimeoutMs?: number;
|
|
64
83
|
}
|
|
65
84
|
|
|
66
85
|
declare function createWebsocketDocConnector(opts: WebsocketDocConnectorOptions): DocConnector;
|
|
@@ -104,8 +123,39 @@ interface RuntimeAvailability {
|
|
|
104
123
|
state: 'unavailable' | 'starting' | 'busy';
|
|
105
124
|
|
|
106
125
|
reason?: string;
|
|
126
|
+
|
|
127
|
+
wake?: RuntimeWakeDetail;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
type RuntimeWakeReasonCode = 'capture-attested' | 'no-portable-golden' | 'portable-golden-release-mismatch' | 'portable-golden-attestation-invalid';
|
|
131
|
+
|
|
132
|
+
interface RuntimeWakeGolden {
|
|
133
|
+
snapshotId: string;
|
|
134
|
+
snapshotCompatKey: string;
|
|
135
|
+
artifactSizeBytes: number;
|
|
136
|
+
durableArenaBytes: number;
|
|
137
|
+
volatileArenaBytes: 0;
|
|
138
|
+
uncoveredWeightBytes: number;
|
|
139
|
+
}
|
|
140
|
+
interface RuntimeWakeDetailBase {
|
|
141
|
+
schema: 'urun.runtime.wake.v1';
|
|
142
|
+
expectationBasis: 'snapshot-registry';
|
|
143
|
+
restoreObservation: 'not-observed';
|
|
107
144
|
}
|
|
108
145
|
|
|
146
|
+
type RuntimeWakeDetail = (RuntimeWakeDetailBase & {
|
|
147
|
+
portability: 'portable';
|
|
148
|
+
expectedWakePath: 'portable-golden-restore';
|
|
149
|
+
reasonCode: 'capture-attested';
|
|
150
|
+
golden: RuntimeWakeGolden;
|
|
151
|
+
}) | (RuntimeWakeDetailBase & {
|
|
152
|
+
portability: 'none';
|
|
153
|
+
expectedWakePath: 'cold-boot';
|
|
154
|
+
reasonCode: Exclude<RuntimeWakeReasonCode, 'capture-attested'>;
|
|
155
|
+
|
|
156
|
+
golden?: never;
|
|
157
|
+
});
|
|
158
|
+
|
|
109
159
|
type SessionFailureKind = 'create-failed' | 'never-live' | 'transport-failed' | 'media-permission' | 'ended' | 'runtime-failed' | 'expired' | 'produce-timeout';
|
|
110
160
|
|
|
111
161
|
interface SessionPhaseError {
|
|
@@ -278,6 +328,8 @@ interface SessionDocument {
|
|
|
278
328
|
readonly synced: boolean;
|
|
279
329
|
|
|
280
330
|
onSynced(handler: () => void): () => void;
|
|
331
|
+
|
|
332
|
+
onConnectionState?(handler: (state: DocConnectionState) => void): () => void;
|
|
281
333
|
}
|
|
282
334
|
|
|
283
335
|
interface SessionStream {
|
|
@@ -527,6 +579,8 @@ interface SessionGatewayResponse {
|
|
|
527
579
|
|
|
528
580
|
runtime_reason?: string;
|
|
529
581
|
|
|
582
|
+
runtime_wake?: unknown;
|
|
583
|
+
|
|
530
584
|
ends_at?: string;
|
|
531
585
|
error_code?: string;
|
|
532
586
|
error_message?: string;
|
|
@@ -748,28 +802,12 @@ declare class TransportSession {
|
|
|
748
802
|
|
|
749
803
|
private _wakingSince;
|
|
750
804
|
|
|
751
|
-
private
|
|
752
|
-
|
|
753
|
-
private _lastInboundTotal;
|
|
754
|
-
|
|
755
|
-
private _mediaEverFlowed;
|
|
756
|
-
|
|
757
|
-
private _lastInboundAdvanceAt;
|
|
805
|
+
private _mediaProbeTimer;
|
|
758
806
|
|
|
759
|
-
private
|
|
760
|
-
|
|
761
|
-
private _decodeSignalSeen;
|
|
762
|
-
|
|
763
|
-
private _lastFramesDecoded;
|
|
764
|
-
|
|
765
|
-
private _lastDecodeAdvanceAt;
|
|
807
|
+
private _joinProbes;
|
|
766
808
|
|
|
767
809
|
private _decodeDeathHandled;
|
|
768
810
|
|
|
769
|
-
private _latestInboundSample;
|
|
770
|
-
|
|
771
|
-
private _decodeWindowStartSample;
|
|
772
|
-
|
|
773
811
|
private _selectedCandidatePair;
|
|
774
812
|
|
|
775
813
|
private _candidatePairDiagnosticEmitted;
|
|
@@ -902,13 +940,14 @@ declare class TransportSession {
|
|
|
902
940
|
|
|
903
941
|
private _closeConsumersByProducer;
|
|
904
942
|
private _mediaPollMs;
|
|
905
|
-
private _mediaStallTimeoutMs;
|
|
906
943
|
|
|
907
|
-
private
|
|
908
|
-
|
|
909
|
-
private
|
|
944
|
+
private _firstFrameWindowMs;
|
|
945
|
+
|
|
946
|
+
private _startMediaProbe;
|
|
947
|
+
private _stopMediaProbe;
|
|
910
948
|
|
|
911
|
-
private
|
|
949
|
+
private _resetJoinProbes;
|
|
950
|
+
private _sampleMediaArrival;
|
|
912
951
|
|
|
913
952
|
private _renegotiate;
|
|
914
953
|
|
|
@@ -974,6 +1013,8 @@ declare class SessionDocumentImpl implements SessionDocument {
|
|
|
974
1013
|
|
|
975
1014
|
ensureConnected(): void;
|
|
976
1015
|
|
|
1016
|
+
onConnectionState(handler: (state: DocConnectionState) => void): () => void;
|
|
1017
|
+
|
|
977
1018
|
onSynced(handler: () => void): () => void;
|
|
978
1019
|
|
|
979
1020
|
set(patch: Record<string, unknown>): void;
|
|
@@ -1032,4 +1073,4 @@ interface DataChannelTransport {
|
|
|
1032
1073
|
|
|
1033
1074
|
declare function transportStreamData(transport: DataChannelTransport): StreamDataTransport;
|
|
1034
1075
|
|
|
1035
|
-
export { type
|
|
1076
|
+
export { type SessionFailureKind as $, type AccessTokenOptions$1 as A, type PrewakeStatus as B, type ChannelEndpoint as C, DERIVED_LEG_SEP as D, type RecordingBucket as E, type RecordingLifecycle as F, type RecordingStatus as G, type RecordingsAccessor as H, type ReleaseSessionBeaconOptions as I, type RequestOptions as J, type RequestStreamOptions as K, LoopbackStreamData as L, type MediaChunkBinding as M, type RuntimeArtifact as N, type RuntimeArtifactDownload as O, type Presence as P, type RuntimeArtifactsAccessor as Q, type Recording as R, type RuntimeAvailability as S, type RuntimeWakeDetail as T, type RuntimeWakeGolden as U, type RuntimeWakeReasonCode as V, type Session as W, type SessionDiagnostic as X, type SessionDocument as Y, SessionDocumentImpl as Z, type SessionEndResult as _, type AccessTokenOptions as a, type SessionPhase as a0, type SessionPhaseError as a1, type SessionPhaseName as a2, type SessionStartOptions as a3, type SessionStatus as a4, type SessionStream as a5, type SessionText as a6, type Store as a7, type StoreOptions as a8, type StreamChunkOptions as a9, type StreamDataTransport as aa, TransportSession as ab, type TransportSessionOptions as ac, type TransportState as ad, allocateSession as ae, createPresence as af, createWebsocketDocConnector as ag, deriveYjsServerUrl as ah, derivedLegName as ai, derivedLegRole as aj, isPendingRecording as ak, mediaRecorderChunkSource as al, prewake as am, releaseSessionBeacon as an, streamDataLabel as ao, transportStreamData as ap, type ActivationEvent as b, type ActivationState as c, type AllocateSessionOptions as d, type AllocatedSession as e, type App as f, type AppOptions as g, type AttachOptions as h, type ChannelMessage as i, ChannelMultiplexer as j, type ChannelName as k, type ChunkReadable as l, DOC_SYNC_WIRE_CONTRACT_VERSION as m, DeferredChannelMultiplexer as n, DeferredDocConnector as o, type DerivedLegRole as p, type DocConnection as q, type DocConnectionState as r, type DocConnector as s, type DocTokenSupplier as t, type MediaChunkSource as u, type MediaChunkSourceFactory as v, type MediaRecorderChunkSourceOptions as w, type PresenceState as x, type PrewakeOptions as y, type PrewakeResult as z };
|