@urun-sh/core 0.2.17 → 0.2.19

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 s,B as m,C as c,D as i,E as f,F as x,G as C,H as l,a as e,b as r,u as o,v as t,w as a,y as n,z as p}from"./chunk-62CZN6MU.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};
2
+ import{A as s,B as m,C as c,D as i,E as f,F as x,G as C,H as l,a as e,b as r,u as o,v as t,w as a,y as n,z as p}from"./chunk-U7DZ4QVH.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};
@@ -119,6 +119,30 @@ interface SessionPhaseError {
119
119
  httpStatus?: number;
120
120
  }
121
121
 
122
+ interface SessionDiagnostic {
123
+
124
+ level: 'info' | 'warning' | 'error';
125
+
126
+ kind: string;
127
+
128
+ message: string;
129
+
130
+ detail?: Record<string, unknown>;
131
+ }
132
+
133
+ type ActivationState = 'activating' | 'still-activating' | 'cold-boot' | 'degraded' | 'first-media';
134
+
135
+ interface ActivationEvent {
136
+
137
+ state: ActivationState;
138
+
139
+ elapsedMs: number;
140
+
141
+ hint?: string;
142
+
143
+ stream?: string;
144
+ }
145
+
122
146
  interface SessionPhase {
123
147
 
124
148
  name: SessionPhaseName;
@@ -385,6 +409,8 @@ interface Session {
385
409
 
386
410
  doc(key: string): SessionDocument;
387
411
 
412
+ readonly mediaTransport: 'webtransport' | 'webrtc' | null;
413
+
388
414
  readonly presence: Presence;
389
415
 
390
416
  touch(): void;
@@ -397,6 +423,10 @@ interface Session {
397
423
 
398
424
  onPhase(handler: (phase: SessionPhase) => void): () => void;
399
425
 
426
+ onDiagnostic(handler: (diagnostic: SessionDiagnostic) => void): () => void;
427
+
428
+ onActivation?(handler: (event: ActivationEvent) => void): () => void;
429
+
400
430
  whenLive(options?: {
401
431
  timeout?: number;
402
432
  signal?: AbortSignal;
@@ -511,6 +541,8 @@ interface AppOptions {
511
541
  authProvider?: string;
512
542
 
513
543
  functionsUrl?: string;
544
+
545
+ allowWebTransport?: boolean;
514
546
  }
515
547
  interface AccessTokenOptions {
516
548
  forceRefresh?: boolean;
@@ -596,6 +628,8 @@ interface TransportEvents {
596
628
 
597
629
  phase: (phase: SessionPhase) => void;
598
630
 
631
+ diagnostic: (diagnostic: SessionDiagnostic) => void;
632
+
599
633
  seeked: (stream: string, target: number | 'live') => void;
600
634
 
601
635
  signal: (msg: Record<string, unknown>) => void;
@@ -735,6 +769,8 @@ declare class TransportSession {
735
769
  connect(startOptions?: SessionStartOptions): Promise<void>;
736
770
  disconnect(): void;
737
771
  on<E extends keyof TransportEvents>(event: E, handler: TransportEvents[E]): () => void;
772
+
773
+ private _emitDiagnostic;
738
774
  sendInput(data: Record<string, unknown>, sequence?: number): void;
739
775
 
740
776
  sendSignal(msg: Record<string, unknown>): void;
@@ -932,4 +968,4 @@ interface DataChannelTransport {
932
968
 
933
969
  declare function transportStreamData(transport: DataChannelTransport): StreamDataTransport;
934
970
 
935
- export { TransportSession 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 SessionEndResult as J, type SessionFailureKind as K, type Layer as L, type MediaChunkBinding as M, type SessionPhase as N, type SessionPhaseError as O, type Presence as P, type SessionPhaseName as Q, type Recording as R, type SceneContext as S, type SessionStartOptions as T, type SessionStatus as U, type SessionStream as V, type SessionText as W, type Store as X, type StoreOptions as Y, type StreamChunkOptions as Z, type StreamDataTransport as _, type App as a, type TransportSessionOptions as a0, type TransportState as a1, createPresence as a2, createWebsocketDocConnector as a3, deriveYjsServerUrl as a4, isPendingRecording as a5, mediaRecorderChunkSource as a6, streamDataLabel as a7, transportStreamData as a8, 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 };
971
+ export { type StoreOptions as $, type AccessTokenOptions as A, type RuntimeArtifact as B, type ChannelEndpoint as C, DOC_SYNC_WIRE_CONTRACT_VERSION as D, type RuntimeArtifactDownload as E, type RuntimeArtifactsAccessor as F, type RuntimeAvailability as G, type SceneGraph as H, type Session as I, type SessionDiagnostic as J, type SessionDocument as K, type Layer as L, type MediaChunkBinding as M, SessionDocumentImpl as N, type SessionEndResult as O, type Presence as P, type SessionFailureKind as Q, type Recording as R, type SceneContext as S, type SessionPhase as T, type SessionPhaseError as U, type SessionPhaseName as V, type SessionStartOptions as W, type SessionStatus as X, type SessionStream as Y, type SessionText as Z, type Store as _, type ActivationEvent as a, type StreamChunkOptions as a0, type StreamDataTransport as a1, TransportSession as a2, type TransportSessionOptions as a3, type TransportState as a4, createPresence as a5, createWebsocketDocConnector as a6, deriveYjsServerUrl as a7, isPendingRecording as a8, mediaRecorderChunkSource as a9, streamDataLabel as aa, transportStreamData as ab, type ActivationState as b, type App as c, type AppOptions as d, type AttachOptions as e, type ChannelMessage as f, ChannelMultiplexer as g, type ChannelName as h, type ChunkReadable as i, DeferredChannelMultiplexer as j, DeferredDocConnector as k, type DocConnection as l, type DocConnector as m, type LayoutConfig as n, type LayoutContext as o, LoopbackStreamData as p, type MediaChunkSource as q, type MediaChunkSourceFactory as r, type MediaRecorderChunkSourceOptions as s, type PresenceState as t, type RecordingBucket as u, type RecordingLifecycle as v, type RecordingStatus as w, type RecordingsAccessor as x, type RequestOptions as y, type RequestStreamOptions as z };
@@ -119,6 +119,30 @@ interface SessionPhaseError {
119
119
  httpStatus?: number;
120
120
  }
121
121
 
122
+ interface SessionDiagnostic {
123
+
124
+ level: 'info' | 'warning' | 'error';
125
+
126
+ kind: string;
127
+
128
+ message: string;
129
+
130
+ detail?: Record<string, unknown>;
131
+ }
132
+
133
+ type ActivationState = 'activating' | 'still-activating' | 'cold-boot' | 'degraded' | 'first-media';
134
+
135
+ interface ActivationEvent {
136
+
137
+ state: ActivationState;
138
+
139
+ elapsedMs: number;
140
+
141
+ hint?: string;
142
+
143
+ stream?: string;
144
+ }
145
+
122
146
  interface SessionPhase {
123
147
 
124
148
  name: SessionPhaseName;
@@ -385,6 +409,8 @@ interface Session {
385
409
 
386
410
  doc(key: string): SessionDocument;
387
411
 
412
+ readonly mediaTransport: 'webtransport' | 'webrtc' | null;
413
+
388
414
  readonly presence: Presence;
389
415
 
390
416
  touch(): void;
@@ -397,6 +423,10 @@ interface Session {
397
423
 
398
424
  onPhase(handler: (phase: SessionPhase) => void): () => void;
399
425
 
426
+ onDiagnostic(handler: (diagnostic: SessionDiagnostic) => void): () => void;
427
+
428
+ onActivation?(handler: (event: ActivationEvent) => void): () => void;
429
+
400
430
  whenLive(options?: {
401
431
  timeout?: number;
402
432
  signal?: AbortSignal;
@@ -511,6 +541,8 @@ interface AppOptions {
511
541
  authProvider?: string;
512
542
 
513
543
  functionsUrl?: string;
544
+
545
+ allowWebTransport?: boolean;
514
546
  }
515
547
  interface AccessTokenOptions {
516
548
  forceRefresh?: boolean;
@@ -596,6 +628,8 @@ interface TransportEvents {
596
628
 
597
629
  phase: (phase: SessionPhase) => void;
598
630
 
631
+ diagnostic: (diagnostic: SessionDiagnostic) => void;
632
+
599
633
  seeked: (stream: string, target: number | 'live') => void;
600
634
 
601
635
  signal: (msg: Record<string, unknown>) => void;
@@ -735,6 +769,8 @@ declare class TransportSession {
735
769
  connect(startOptions?: SessionStartOptions): Promise<void>;
736
770
  disconnect(): void;
737
771
  on<E extends keyof TransportEvents>(event: E, handler: TransportEvents[E]): () => void;
772
+
773
+ private _emitDiagnostic;
738
774
  sendInput(data: Record<string, unknown>, sequence?: number): void;
739
775
 
740
776
  sendSignal(msg: Record<string, unknown>): void;
@@ -932,4 +968,4 @@ interface DataChannelTransport {
932
968
 
933
969
  declare function transportStreamData(transport: DataChannelTransport): StreamDataTransport;
934
970
 
935
- export { TransportSession 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 SessionEndResult as J, type SessionFailureKind as K, type Layer as L, type MediaChunkBinding as M, type SessionPhase as N, type SessionPhaseError as O, type Presence as P, type SessionPhaseName as Q, type Recording as R, type SceneContext as S, type SessionStartOptions as T, type SessionStatus as U, type SessionStream as V, type SessionText as W, type Store as X, type StoreOptions as Y, type StreamChunkOptions as Z, type StreamDataTransport as _, type App as a, type TransportSessionOptions as a0, type TransportState as a1, createPresence as a2, createWebsocketDocConnector as a3, deriveYjsServerUrl as a4, isPendingRecording as a5, mediaRecorderChunkSource as a6, streamDataLabel as a7, transportStreamData as a8, 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 };
971
+ export { type StoreOptions as $, type AccessTokenOptions as A, type RuntimeArtifact as B, type ChannelEndpoint as C, DOC_SYNC_WIRE_CONTRACT_VERSION as D, type RuntimeArtifactDownload as E, type RuntimeArtifactsAccessor as F, type RuntimeAvailability as G, type SceneGraph as H, type Session as I, type SessionDiagnostic as J, type SessionDocument as K, type Layer as L, type MediaChunkBinding as M, SessionDocumentImpl as N, type SessionEndResult as O, type Presence as P, type SessionFailureKind as Q, type Recording as R, type SceneContext as S, type SessionPhase as T, type SessionPhaseError as U, type SessionPhaseName as V, type SessionStartOptions as W, type SessionStatus as X, type SessionStream as Y, type SessionText as Z, type Store as _, type ActivationEvent as a, type StreamChunkOptions as a0, type StreamDataTransport as a1, TransportSession as a2, type TransportSessionOptions as a3, type TransportState as a4, createPresence as a5, createWebsocketDocConnector as a6, deriveYjsServerUrl as a7, isPendingRecording as a8, mediaRecorderChunkSource as a9, streamDataLabel as aa, transportStreamData as ab, type ActivationState as b, type App as c, type AppOptions as d, type AttachOptions as e, type ChannelMessage as f, ChannelMultiplexer as g, type ChannelName as h, type ChunkReadable as i, DeferredChannelMultiplexer as j, DeferredDocConnector as k, type DocConnection as l, type DocConnector as m, type LayoutConfig as n, type LayoutContext as o, LoopbackStreamData as p, type MediaChunkSource as q, type MediaChunkSourceFactory as r, type MediaRecorderChunkSourceOptions as s, type PresenceState as t, type RecordingBucket as u, type RecordingLifecycle as v, type RecordingStatus as w, type RecordingsAccessor as x, type RequestOptions as y, type RequestStreamOptions as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urun-sh/core",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "description": "Core transport and channel primitives for the urun TypeScript SDK",
5
5
  "repository": {
6
6
  "type": "git",