@urun-sh/core 0.2.15 → 0.2.17

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-RV6OTRCZ.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;
@@ -362,6 +363,14 @@ interface RequestStreamOptions {
362
363
  docSyncTimeout?: number;
363
364
  }
364
365
 
366
+ type SessionEndResult = {
367
+ status: 'ended';
368
+ requestId: string;
369
+ } | {
370
+ status: 'canceled';
371
+ requestId: string;
372
+ };
373
+
365
374
  interface Session {
366
375
 
367
376
  readonly id: string;
@@ -401,6 +410,8 @@ interface Session {
401
410
 
402
411
  onRecovery(hook: () => void): () => void;
403
412
 
413
+ end(): Promise<SessionEndResult>;
414
+
404
415
  disconnect(): void;
405
416
  }
406
417
 
@@ -586,6 +597,8 @@ interface TransportEvents {
586
597
  phase: (phase: SessionPhase) => void;
587
598
 
588
599
  seeked: (stream: string, target: number | 'live') => void;
600
+
601
+ signal: (msg: Record<string, unknown>) => void;
589
602
  }
590
603
  interface SessionStartOptions {
591
604
  app?: string;
@@ -610,6 +623,8 @@ declare class TransportSession {
610
623
  private _options;
611
624
  private _emitter;
612
625
  private _ws;
626
+
627
+ private _connectedUrl;
613
628
  private _device;
614
629
  private _recvTransport;
615
630
  private _sendTransport;
@@ -702,6 +717,8 @@ declare class TransportSession {
702
717
  get multiplexer(): ChannelMultiplexer | null;
703
718
  get isOpen(): boolean;
704
719
 
720
+ get connectedUrl(): string | null;
721
+
705
722
  getTrackByName(name: string): MediaStreamTrack | undefined;
706
723
  setAuth(options: Pick<TransportSessionOptions, 'orgId' | 'jwt' | 'authProvider'>): void;
707
724
  constructor(options?: TransportSessionOptions);
@@ -720,6 +737,10 @@ declare class TransportSession {
720
737
  on<E extends keyof TransportEvents>(event: E, handler: TransportEvents[E]): () => void;
721
738
  sendInput(data: Record<string, unknown>, sequence?: number): void;
722
739
 
740
+ sendSignal(msg: Record<string, unknown>): void;
741
+
742
+ onSignal(handler: (msg: Record<string, unknown>) => void): () => void;
743
+
723
744
  onStreamData(name: string, handler: (payload: unknown) => void): () => void;
724
745
 
725
746
  sendStreamData(name: string, payload: unknown, _options?: {
@@ -911,4 +932,4 @@ interface DataChannelTransport {
911
932
 
912
933
  declare function transportStreamData(transport: DataChannelTransport): StreamDataTransport;
913
934
 
914
- 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 };
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 };
@@ -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;
@@ -362,6 +363,14 @@ interface RequestStreamOptions {
362
363
  docSyncTimeout?: number;
363
364
  }
364
365
 
366
+ type SessionEndResult = {
367
+ status: 'ended';
368
+ requestId: string;
369
+ } | {
370
+ status: 'canceled';
371
+ requestId: string;
372
+ };
373
+
365
374
  interface Session {
366
375
 
367
376
  readonly id: string;
@@ -401,6 +410,8 @@ interface Session {
401
410
 
402
411
  onRecovery(hook: () => void): () => void;
403
412
 
413
+ end(): Promise<SessionEndResult>;
414
+
404
415
  disconnect(): void;
405
416
  }
406
417
 
@@ -586,6 +597,8 @@ interface TransportEvents {
586
597
  phase: (phase: SessionPhase) => void;
587
598
 
588
599
  seeked: (stream: string, target: number | 'live') => void;
600
+
601
+ signal: (msg: Record<string, unknown>) => void;
589
602
  }
590
603
  interface SessionStartOptions {
591
604
  app?: string;
@@ -610,6 +623,8 @@ declare class TransportSession {
610
623
  private _options;
611
624
  private _emitter;
612
625
  private _ws;
626
+
627
+ private _connectedUrl;
613
628
  private _device;
614
629
  private _recvTransport;
615
630
  private _sendTransport;
@@ -702,6 +717,8 @@ declare class TransportSession {
702
717
  get multiplexer(): ChannelMultiplexer | null;
703
718
  get isOpen(): boolean;
704
719
 
720
+ get connectedUrl(): string | null;
721
+
705
722
  getTrackByName(name: string): MediaStreamTrack | undefined;
706
723
  setAuth(options: Pick<TransportSessionOptions, 'orgId' | 'jwt' | 'authProvider'>): void;
707
724
  constructor(options?: TransportSessionOptions);
@@ -720,6 +737,10 @@ declare class TransportSession {
720
737
  on<E extends keyof TransportEvents>(event: E, handler: TransportEvents[E]): () => void;
721
738
  sendInput(data: Record<string, unknown>, sequence?: number): void;
722
739
 
740
+ sendSignal(msg: Record<string, unknown>): void;
741
+
742
+ onSignal(handler: (msg: Record<string, unknown>) => void): () => void;
743
+
723
744
  onStreamData(name: string, handler: (payload: unknown) => void): () => void;
724
745
 
725
746
  sendStreamData(name: string, payload: unknown, _options?: {
@@ -911,4 +932,4 @@ interface DataChannelTransport {
911
932
 
912
933
  declare function transportStreamData(transport: DataChannelTransport): StreamDataTransport;
913
934
 
914
- 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 };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urun-sh/core",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
4
4
  "description": "Core transport and channel primitives for the urun TypeScript SDK",
5
5
  "repository": {
6
6
  "type": "git",
@@ -99,6 +99,7 @@
99
99
  },
100
100
  "license": "MIT",
101
101
  "dependencies": {
102
+ "@msgpack/msgpack": "^3.1.2",
102
103
  "debug": "^4.4.3",
103
104
  "y-protocols": "1.0.7",
104
105
  "y-websocket": "3.0.0",