@urun-sh/core 0.2.16 → 0.2.18

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 c,B as i,C as f,D as x,E as C,F as l,a as e,b as r,s as o,t,u as a,w as n,x as p,y as s,z as m}from"./chunk-GKS24GDI.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-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};
@@ -67,6 +67,7 @@ declare function createWebsocketDocConnector(opts: WebsocketDocConnectorOptions)
67
67
 
68
68
  declare class DeferredDocConnector {
69
69
  private _target;
70
+
70
71
  private _bridges;
71
72
 
72
73
  readonly connect: DocConnector;
@@ -118,6 +119,19 @@ interface SessionPhaseError {
118
119
  httpStatus?: number;
119
120
  }
120
121
 
122
+ type ActivationState = 'activating' | 'still-activating' | 'cold-boot' | 'degraded' | 'first-media';
123
+
124
+ interface ActivationEvent {
125
+
126
+ state: ActivationState;
127
+
128
+ elapsedMs: number;
129
+
130
+ hint?: string;
131
+
132
+ stream?: string;
133
+ }
134
+
121
135
  interface SessionPhase {
122
136
 
123
137
  name: SessionPhaseName;
@@ -362,6 +376,14 @@ interface RequestStreamOptions {
362
376
  docSyncTimeout?: number;
363
377
  }
364
378
 
379
+ type SessionEndResult = {
380
+ status: 'ended';
381
+ requestId: string;
382
+ } | {
383
+ status: 'canceled';
384
+ requestId: string;
385
+ };
386
+
365
387
  interface Session {
366
388
 
367
389
  readonly id: string;
@@ -376,6 +398,8 @@ interface Session {
376
398
 
377
399
  doc(key: string): SessionDocument;
378
400
 
401
+ readonly mediaTransport: 'webtransport' | 'webrtc' | null;
402
+
379
403
  readonly presence: Presence;
380
404
 
381
405
  touch(): void;
@@ -388,6 +412,8 @@ interface Session {
388
412
 
389
413
  onPhase(handler: (phase: SessionPhase) => void): () => void;
390
414
 
415
+ onActivation?(handler: (event: ActivationEvent) => void): () => void;
416
+
391
417
  whenLive(options?: {
392
418
  timeout?: number;
393
419
  signal?: AbortSignal;
@@ -401,6 +427,8 @@ interface Session {
401
427
 
402
428
  onRecovery(hook: () => void): () => void;
403
429
 
430
+ end(): Promise<SessionEndResult>;
431
+
404
432
  disconnect(): void;
405
433
  }
406
434
 
@@ -500,6 +528,8 @@ interface AppOptions {
500
528
  authProvider?: string;
501
529
 
502
530
  functionsUrl?: string;
531
+
532
+ allowWebTransport?: boolean;
503
533
  }
504
534
  interface AccessTokenOptions {
505
535
  forceRefresh?: boolean;
@@ -612,6 +642,8 @@ declare class TransportSession {
612
642
  private _options;
613
643
  private _emitter;
614
644
  private _ws;
645
+
646
+ private _connectedUrl;
615
647
  private _device;
616
648
  private _recvTransport;
617
649
  private _sendTransport;
@@ -704,6 +736,8 @@ declare class TransportSession {
704
736
  get multiplexer(): ChannelMultiplexer | null;
705
737
  get isOpen(): boolean;
706
738
 
739
+ get connectedUrl(): string | null;
740
+
707
741
  getTrackByName(name: string): MediaStreamTrack | undefined;
708
742
  setAuth(options: Pick<TransportSessionOptions, 'orgId' | 'jwt' | 'authProvider'>): void;
709
743
  constructor(options?: TransportSessionOptions);
@@ -917,4 +951,4 @@ interface DataChannelTransport {
917
951
 
918
952
  declare function transportStreamData(transport: DataChannelTransport): StreamDataTransport;
919
953
 
920
- 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 };
954
+ export { type StreamChunkOptions 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 SessionDocument as J, SessionDocumentImpl as K, type Layer as L, type MediaChunkBinding as M, type SessionEndResult as N, type SessionFailureKind as O, type Presence as P, type SessionPhase as Q, type Recording as R, type SceneContext as S, type SessionPhaseError as T, type SessionPhaseName as U, type SessionStartOptions as V, type SessionStatus as W, type SessionStream as X, type SessionText as Y, type Store as Z, type StoreOptions as _, type ActivationEvent as a, type StreamDataTransport as a0, TransportSession as a1, type TransportSessionOptions as a2, type TransportState as a3, createPresence as a4, createWebsocketDocConnector as a5, deriveYjsServerUrl as a6, isPendingRecording as a7, mediaRecorderChunkSource as a8, streamDataLabel as a9, transportStreamData as aa, 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 };
@@ -67,6 +67,7 @@ declare function createWebsocketDocConnector(opts: WebsocketDocConnectorOptions)
67
67
 
68
68
  declare class DeferredDocConnector {
69
69
  private _target;
70
+
70
71
  private _bridges;
71
72
 
72
73
  readonly connect: DocConnector;
@@ -118,6 +119,19 @@ interface SessionPhaseError {
118
119
  httpStatus?: number;
119
120
  }
120
121
 
122
+ type ActivationState = 'activating' | 'still-activating' | 'cold-boot' | 'degraded' | 'first-media';
123
+
124
+ interface ActivationEvent {
125
+
126
+ state: ActivationState;
127
+
128
+ elapsedMs: number;
129
+
130
+ hint?: string;
131
+
132
+ stream?: string;
133
+ }
134
+
121
135
  interface SessionPhase {
122
136
 
123
137
  name: SessionPhaseName;
@@ -362,6 +376,14 @@ interface RequestStreamOptions {
362
376
  docSyncTimeout?: number;
363
377
  }
364
378
 
379
+ type SessionEndResult = {
380
+ status: 'ended';
381
+ requestId: string;
382
+ } | {
383
+ status: 'canceled';
384
+ requestId: string;
385
+ };
386
+
365
387
  interface Session {
366
388
 
367
389
  readonly id: string;
@@ -376,6 +398,8 @@ interface Session {
376
398
 
377
399
  doc(key: string): SessionDocument;
378
400
 
401
+ readonly mediaTransport: 'webtransport' | 'webrtc' | null;
402
+
379
403
  readonly presence: Presence;
380
404
 
381
405
  touch(): void;
@@ -388,6 +412,8 @@ interface Session {
388
412
 
389
413
  onPhase(handler: (phase: SessionPhase) => void): () => void;
390
414
 
415
+ onActivation?(handler: (event: ActivationEvent) => void): () => void;
416
+
391
417
  whenLive(options?: {
392
418
  timeout?: number;
393
419
  signal?: AbortSignal;
@@ -401,6 +427,8 @@ interface Session {
401
427
 
402
428
  onRecovery(hook: () => void): () => void;
403
429
 
430
+ end(): Promise<SessionEndResult>;
431
+
404
432
  disconnect(): void;
405
433
  }
406
434
 
@@ -500,6 +528,8 @@ interface AppOptions {
500
528
  authProvider?: string;
501
529
 
502
530
  functionsUrl?: string;
531
+
532
+ allowWebTransport?: boolean;
503
533
  }
504
534
  interface AccessTokenOptions {
505
535
  forceRefresh?: boolean;
@@ -612,6 +642,8 @@ declare class TransportSession {
612
642
  private _options;
613
643
  private _emitter;
614
644
  private _ws;
645
+
646
+ private _connectedUrl;
615
647
  private _device;
616
648
  private _recvTransport;
617
649
  private _sendTransport;
@@ -704,6 +736,8 @@ declare class TransportSession {
704
736
  get multiplexer(): ChannelMultiplexer | null;
705
737
  get isOpen(): boolean;
706
738
 
739
+ get connectedUrl(): string | null;
740
+
707
741
  getTrackByName(name: string): MediaStreamTrack | undefined;
708
742
  setAuth(options: Pick<TransportSessionOptions, 'orgId' | 'jwt' | 'authProvider'>): void;
709
743
  constructor(options?: TransportSessionOptions);
@@ -917,4 +951,4 @@ interface DataChannelTransport {
917
951
 
918
952
  declare function transportStreamData(transport: DataChannelTransport): StreamDataTransport;
919
953
 
920
- 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 };
954
+ export { type StreamChunkOptions 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 SessionDocument as J, SessionDocumentImpl as K, type Layer as L, type MediaChunkBinding as M, type SessionEndResult as N, type SessionFailureKind as O, type Presence as P, type SessionPhase as Q, type Recording as R, type SceneContext as S, type SessionPhaseError as T, type SessionPhaseName as U, type SessionStartOptions as V, type SessionStatus as W, type SessionStream as X, type SessionText as Y, type Store as Z, type StoreOptions as _, type ActivationEvent as a, type StreamDataTransport as a0, TransportSession as a1, type TransportSessionOptions as a2, type TransportState as a3, createPresence as a4, createWebsocketDocConnector as a5, deriveYjsServerUrl as a6, isPendingRecording as a7, mediaRecorderChunkSource as a8, streamDataLabel as a9, transportStreamData as aa, 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.16",
3
+ "version": "0.2.18",
4
4
  "description": "Core transport and channel primitives for the urun TypeScript SDK",
5
5
  "repository": {
6
6
  "type": "git",