@urun-sh/core 0.2.7 → 0.2.8

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/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{a as e,b as r,c as o,d as t,e as a,g as n,h as p,i as s,j as m,k as c,l as i,m as f,n as x,o as l}from"./chunk-YYZIRCR7.mjs";export{e as ChannelMultiplexer,r as DeferredChannelMultiplexer,f as DeferredDocConnector,n as LoopbackStreamData,x as SessionDocumentImpl,m as TransportSession,l as createPresence,i as createWebsocketDocConnector,c as deriveYjsServerUrl,a as ensureNodeWebRTC,o as isNodeRuntime,t as nodeMediasoupHandlerName,s as streamDataLabel,p as transportStreamData};
2
+ import{A as f,B as x,C,D as l,a as e,b as r,q as o,r as t,s as a,u as n,v as p,w as s,x as m,y as c,z as i}from"./chunk-C2B5BLQW.mjs";export{e as ChannelMultiplexer,c as DOC_SYNC_WIRE_CONTRACT_VERSION,r as DeferredChannelMultiplexer,x as DeferredDocConnector,n as LoopbackStreamData,C as SessionDocumentImpl,m as TransportSession,l as createPresence,f as createWebsocketDocConnector,i as deriveYjsServerUrl,a as ensureNodeWebRTC,o as isNodeRuntime,t as nodeMediasoupHandlerName,s as streamDataLabel,p as transportStreamData};
@@ -33,6 +33,8 @@ interface MediaRecorderChunkSourceOptions {
33
33
 
34
34
  declare function mediaRecorderChunkSource(binding: MediaChunkBinding, options?: MediaRecorderChunkSourceOptions): MediaChunkSource;
35
35
 
36
+ declare const DOC_SYNC_WIRE_CONTRACT_VERSION = 1;
37
+
36
38
  interface DocConnection {
37
39
 
38
40
  readonly awareness: Awareness;
@@ -41,6 +43,8 @@ interface DocConnection {
41
43
 
42
44
  onSync(handler: (synced: boolean) => void): () => void;
43
45
 
46
+ ensureConnected?(): void;
47
+
44
48
  destroy(): void;
45
49
  }
46
50
 
@@ -101,7 +105,7 @@ interface RuntimeAvailability {
101
105
  reason?: string;
102
106
  }
103
107
 
104
- type SessionFailureKind = 'create-failed' | 'never-live' | 'transport-failed' | 'media-permission' | 'ended';
108
+ type SessionFailureKind = 'create-failed' | 'never-live' | 'transport-failed' | 'media-permission' | 'ended' | 'runtime-failed';
105
109
 
106
110
  interface SessionPhaseError {
107
111
 
@@ -125,6 +129,8 @@ interface SessionPhase {
125
129
 
126
130
  runtime?: RuntimeAvailability;
127
131
 
132
+ wakingSince?: number;
133
+
128
134
  requestId?: string;
129
135
 
130
136
  sessionId?: string;
@@ -153,6 +159,8 @@ interface SessionStatus {
153
159
 
154
160
  runtime?: RuntimeAvailability;
155
161
 
162
+ wakingSince?: number;
163
+
156
164
  error?: SessionPhaseError;
157
165
  }
158
166
 
@@ -381,6 +389,10 @@ interface Session {
381
389
 
382
390
  readonly artifacts: RuntimeArtifactsAccessor;
383
391
 
392
+ recover(): void;
393
+
394
+ onRecovery(hook: () => void): () => void;
395
+
384
396
  disconnect(): void;
385
397
  }
386
398
 
@@ -620,6 +632,8 @@ declare class TransportSession {
620
632
 
621
633
  private _connectStartedAt;
622
634
 
635
+ private _wakingSince;
636
+
623
637
  private _mediaMonitorTimer;
624
638
 
625
639
  private _lastInboundTotal;
@@ -758,6 +772,8 @@ declare class TransportSession {
758
772
  private _checkDecodeLiveness;
759
773
 
760
774
  private _renegotiate;
775
+
776
+ recover(): void;
761
777
  private _attemptReconnect;
762
778
  private _connectUrls;
763
779
  private _connectOnce;
@@ -813,6 +829,8 @@ declare class SessionDocumentImpl implements SessionDocument {
813
829
 
814
830
  get synced(): boolean;
815
831
 
832
+ ensureConnected(): void;
833
+
816
834
  onSynced(handler: () => void): () => void;
817
835
 
818
836
  set(patch: Record<string, unknown>): void;
@@ -871,4 +889,4 @@ interface DataChannelTransport {
871
889
 
872
890
  declare function transportStreamData(transport: DataChannelTransport): StreamDataTransport;
873
891
 
874
- export { type TransportState as $, type AccessTokenOptions as A, type RuntimeAvailability as B, type ChannelEndpoint as C, DeferredChannelMultiplexer as D, type SceneGraph as E, type Session as F, type SessionDocument as G, SessionDocumentImpl as H, type SessionFailureKind as I, type SessionPhase as J, type SessionPhaseError as K, type Layer as L, type MediaChunkBinding as M, type SessionPhaseName as N, type SessionStartOptions as O, type Presence as P, type SessionStatus as Q, type Recording as R, type SceneContext as S, type SessionStream as T, type SessionText as U, type Store as V, type StoreOptions as W, type StreamChunkOptions as X, type StreamDataTransport as Y, TransportSession as Z, type TransportSessionOptions as _, type App as a, createPresence as a0, createWebsocketDocConnector as a1, deriveYjsServerUrl as a2, isPendingRecording as a3, mediaRecorderChunkSource as a4, streamDataLabel as a5, transportStreamData as a6, type AppOptions as b, type AttachOptions as c, type ChannelMessage as d, ChannelMultiplexer as e, type ChannelName as f, type ChunkReadable as g, DeferredDocConnector as h, type DocConnection as i, type DocConnector as j, type LayoutConfig as k, type LayoutContext as l, LoopbackStreamData as m, type MediaChunkSource as n, type MediaChunkSourceFactory as o, type MediaRecorderChunkSourceOptions as p, type PresenceState as q, type RecordingBucket as r, type RecordingLifecycle as s, type RecordingStatus as t, type RecordingsAccessor as u, type RequestOptions as v, type RequestStreamOptions as w, type RuntimeArtifact as x, type RuntimeArtifactDownload as y, type RuntimeArtifactsAccessor as z };
892
+ export { type TransportSessionOptions as $, type AccessTokenOptions as A, type RuntimeArtifactsAccessor as B, type ChannelEndpoint as C, DOC_SYNC_WIRE_CONTRACT_VERSION as D, type RuntimeAvailability as E, type SceneGraph as F, type Session as G, type SessionDocument as H, SessionDocumentImpl as I, type SessionFailureKind as J, type SessionPhase as K, type Layer as L, type MediaChunkBinding as M, type SessionPhaseError as N, type SessionPhaseName as O, type Presence as P, type SessionStartOptions as Q, type Recording as R, type SceneContext as S, type SessionStatus as T, type SessionStream as U, type SessionText as V, type Store as W, type StoreOptions as X, type StreamChunkOptions as Y, type StreamDataTransport as Z, TransportSession as _, type App as a, type TransportState as a0, createPresence as a1, createWebsocketDocConnector as a2, deriveYjsServerUrl as a3, isPendingRecording as a4, mediaRecorderChunkSource as a5, streamDataLabel as a6, transportStreamData as a7, type AppOptions as b, type AttachOptions as c, type ChannelMessage as d, ChannelMultiplexer as e, type ChannelName as f, type ChunkReadable as g, DeferredChannelMultiplexer as h, DeferredDocConnector as i, type DocConnection as j, type DocConnector as k, type LayoutConfig as l, type LayoutContext as m, LoopbackStreamData as n, type MediaChunkSource as o, type MediaChunkSourceFactory as p, type MediaRecorderChunkSourceOptions as q, type PresenceState as r, type RecordingBucket as s, type RecordingLifecycle as t, type RecordingStatus as u, type RecordingsAccessor as v, type RequestOptions as w, type RequestStreamOptions as x, type RuntimeArtifact as y, type RuntimeArtifactDownload as z };
@@ -33,6 +33,8 @@ interface MediaRecorderChunkSourceOptions {
33
33
 
34
34
  declare function mediaRecorderChunkSource(binding: MediaChunkBinding, options?: MediaRecorderChunkSourceOptions): MediaChunkSource;
35
35
 
36
+ declare const DOC_SYNC_WIRE_CONTRACT_VERSION = 1;
37
+
36
38
  interface DocConnection {
37
39
 
38
40
  readonly awareness: Awareness;
@@ -41,6 +43,8 @@ interface DocConnection {
41
43
 
42
44
  onSync(handler: (synced: boolean) => void): () => void;
43
45
 
46
+ ensureConnected?(): void;
47
+
44
48
  destroy(): void;
45
49
  }
46
50
 
@@ -101,7 +105,7 @@ interface RuntimeAvailability {
101
105
  reason?: string;
102
106
  }
103
107
 
104
- type SessionFailureKind = 'create-failed' | 'never-live' | 'transport-failed' | 'media-permission' | 'ended';
108
+ type SessionFailureKind = 'create-failed' | 'never-live' | 'transport-failed' | 'media-permission' | 'ended' | 'runtime-failed';
105
109
 
106
110
  interface SessionPhaseError {
107
111
 
@@ -125,6 +129,8 @@ interface SessionPhase {
125
129
 
126
130
  runtime?: RuntimeAvailability;
127
131
 
132
+ wakingSince?: number;
133
+
128
134
  requestId?: string;
129
135
 
130
136
  sessionId?: string;
@@ -153,6 +159,8 @@ interface SessionStatus {
153
159
 
154
160
  runtime?: RuntimeAvailability;
155
161
 
162
+ wakingSince?: number;
163
+
156
164
  error?: SessionPhaseError;
157
165
  }
158
166
 
@@ -381,6 +389,10 @@ interface Session {
381
389
 
382
390
  readonly artifacts: RuntimeArtifactsAccessor;
383
391
 
392
+ recover(): void;
393
+
394
+ onRecovery(hook: () => void): () => void;
395
+
384
396
  disconnect(): void;
385
397
  }
386
398
 
@@ -620,6 +632,8 @@ declare class TransportSession {
620
632
 
621
633
  private _connectStartedAt;
622
634
 
635
+ private _wakingSince;
636
+
623
637
  private _mediaMonitorTimer;
624
638
 
625
639
  private _lastInboundTotal;
@@ -758,6 +772,8 @@ declare class TransportSession {
758
772
  private _checkDecodeLiveness;
759
773
 
760
774
  private _renegotiate;
775
+
776
+ recover(): void;
761
777
  private _attemptReconnect;
762
778
  private _connectUrls;
763
779
  private _connectOnce;
@@ -813,6 +829,8 @@ declare class SessionDocumentImpl implements SessionDocument {
813
829
 
814
830
  get synced(): boolean;
815
831
 
832
+ ensureConnected(): void;
833
+
816
834
  onSynced(handler: () => void): () => void;
817
835
 
818
836
  set(patch: Record<string, unknown>): void;
@@ -871,4 +889,4 @@ interface DataChannelTransport {
871
889
 
872
890
  declare function transportStreamData(transport: DataChannelTransport): StreamDataTransport;
873
891
 
874
- export { type TransportState as $, type AccessTokenOptions as A, type RuntimeAvailability as B, type ChannelEndpoint as C, DeferredChannelMultiplexer as D, type SceneGraph as E, type Session as F, type SessionDocument as G, SessionDocumentImpl as H, type SessionFailureKind as I, type SessionPhase as J, type SessionPhaseError as K, type Layer as L, type MediaChunkBinding as M, type SessionPhaseName as N, type SessionStartOptions as O, type Presence as P, type SessionStatus as Q, type Recording as R, type SceneContext as S, type SessionStream as T, type SessionText as U, type Store as V, type StoreOptions as W, type StreamChunkOptions as X, type StreamDataTransport as Y, TransportSession as Z, type TransportSessionOptions as _, type App as a, createPresence as a0, createWebsocketDocConnector as a1, deriveYjsServerUrl as a2, isPendingRecording as a3, mediaRecorderChunkSource as a4, streamDataLabel as a5, transportStreamData as a6, type AppOptions as b, type AttachOptions as c, type ChannelMessage as d, ChannelMultiplexer as e, type ChannelName as f, type ChunkReadable as g, DeferredDocConnector as h, type DocConnection as i, type DocConnector as j, type LayoutConfig as k, type LayoutContext as l, LoopbackStreamData as m, type MediaChunkSource as n, type MediaChunkSourceFactory as o, type MediaRecorderChunkSourceOptions as p, type PresenceState as q, type RecordingBucket as r, type RecordingLifecycle as s, type RecordingStatus as t, type RecordingsAccessor as u, type RequestOptions as v, type RequestStreamOptions as w, type RuntimeArtifact as x, type RuntimeArtifactDownload as y, type RuntimeArtifactsAccessor as z };
892
+ export { type TransportSessionOptions as $, type AccessTokenOptions as A, type RuntimeArtifactsAccessor as B, type ChannelEndpoint as C, DOC_SYNC_WIRE_CONTRACT_VERSION as D, type RuntimeAvailability as E, type SceneGraph as F, type Session as G, type SessionDocument as H, SessionDocumentImpl as I, type SessionFailureKind as J, type SessionPhase as K, type Layer as L, type MediaChunkBinding as M, type SessionPhaseError as N, type SessionPhaseName as O, type Presence as P, type SessionStartOptions as Q, type Recording as R, type SceneContext as S, type SessionStatus as T, type SessionStream as U, type SessionText as V, type Store as W, type StoreOptions as X, type StreamChunkOptions as Y, type StreamDataTransport as Z, TransportSession as _, type App as a, type TransportState as a0, createPresence as a1, createWebsocketDocConnector as a2, deriveYjsServerUrl as a3, isPendingRecording as a4, mediaRecorderChunkSource as a5, streamDataLabel as a6, transportStreamData as a7, type AppOptions as b, type AttachOptions as c, type ChannelMessage as d, ChannelMultiplexer as e, type ChannelName as f, type ChunkReadable as g, DeferredChannelMultiplexer as h, DeferredDocConnector as i, type DocConnection as j, type DocConnector as k, type LayoutConfig as l, type LayoutContext as m, LoopbackStreamData as n, type MediaChunkSource as o, type MediaChunkSourceFactory as p, type MediaRecorderChunkSourceOptions as q, type PresenceState as r, type RecordingBucket as s, type RecordingLifecycle as t, type RecordingStatus as u, type RecordingsAccessor as v, type RequestOptions as w, type RequestStreamOptions as x, type RuntimeArtifact as y, type RuntimeArtifactDownload as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urun-sh/core",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Core transport and channel primitives for the urun TypeScript SDK",
5
5
  "repository": {
6
6
  "type": "git",