@urun-sh/core 0.4.2 → 0.5.0

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{$ as m,G as r,M as t,N as n,O as a,P as s,U as p,V as c,W as l,a as e,aa as i,b as o,ba as S,ca as f,da as x,ea as C,fa as D}from"./chunk-HOQ5WCT6.mjs";export{e as ChannelMultiplexer,i as DOC_SYNC_WIRE_CONTRACT_VERSION,o as DeferredChannelMultiplexer,x as DeferredDocConnector,p as LoopbackStreamData,C as SessionDocumentImpl,m as TransportSession,r as allocateSession,D as createPresence,f as createWebsocketDocConnector,S as deriveYjsServerUrl,s as ensureNodeWebRTC,t as isNodeRuntime,n as nodeMediasoupHandlerName,a as nodeWebRTCUnavailableReason,l as streamDataLabel,c as transportStreamData};
2
+ import{H as r,N as t,O as n,P as a,Q as s,V as p,W as c,X as l,a as e,aa as m,b as o,ba as i,ca as S,da as f,ea as x,fa as C,ga as D}from"./chunk-XHXPCJYZ.mjs";export{e as ChannelMultiplexer,i as DOC_SYNC_WIRE_CONTRACT_VERSION,o as DeferredChannelMultiplexer,x as DeferredDocConnector,p as LoopbackStreamData,C as SessionDocumentImpl,m as TransportSession,r as allocateSession,D as createPresence,f as createWebsocketDocConnector,S as deriveYjsServerUrl,s as ensureNodeWebRTC,t as isNodeRuntime,n as nodeMediasoupHandlerName,a as nodeWebRTCUnavailableReason,l as streamDataLabel,c as transportStreamData};
@@ -188,6 +188,8 @@ interface SessionPhaseError {
188
188
  kind?: SessionFailureKind;
189
189
 
190
190
  httpStatus?: number;
191
+
192
+ retryAfterSeconds?: number;
191
193
  }
192
194
 
193
195
  interface SessionDiagnostic {
@@ -461,9 +463,11 @@ interface RequestStreamOptions {
461
463
  }
462
464
 
463
465
  type SessionEndResult = {
464
- status: 'ended';
465
- requestId: string;
466
- platformStatus?: string;
466
+ status: 'paused';
467
+
468
+ sessionId: string;
469
+
470
+ reason: string;
467
471
  } | {
468
472
  status: 'canceled';
469
473
  requestId: string;
@@ -521,6 +525,8 @@ interface Session {
521
525
 
522
526
  end(): Promise<SessionEndResult>;
523
527
 
528
+ cancel(): Promise<SessionEndResult>;
529
+
524
530
  detach(): void;
525
531
 
526
532
  disconnect(): void;
@@ -676,7 +682,13 @@ interface App {
676
682
 
677
683
  type SessionGatewayStatus = 'allocated' | 'pending' | 'queued' | 'rejected' | 'failed' | 'canceled'
678
684
 
679
- | 'redirect';
685
+ | 'paused'
686
+
687
+ | 'redirect'
688
+
689
+ | 'waiting_for_capacity'
690
+
691
+ | (string & {});
680
692
  interface SessionGatewayResponse {
681
693
  status?: SessionGatewayStatus;
682
694
 
@@ -697,6 +709,14 @@ interface SessionGatewayResponse {
697
709
 
698
710
  runtime_reason?: string;
699
711
 
712
+ reason?: string;
713
+
714
+ decision_reason?: string;
715
+
716
+ provisioning_refusal_source?: string;
717
+
718
+ provisioning_refusal_message?: string;
719
+
700
720
  runtime_wake?: unknown;
701
721
 
702
722
  ends_at?: string;
@@ -711,7 +731,7 @@ interface SessionGatewayResponse {
711
731
 
712
732
  interface AdmissionUpdate {
713
733
 
714
- status: 'queued' | 'pending';
734
+ status: string;
715
735
 
716
736
  requestId?: string;
717
737
 
@@ -721,6 +741,14 @@ interface AdmissionUpdate {
721
741
  };
722
742
 
723
743
  runtime?: RuntimeAvailability;
744
+
745
+ reason?: string;
746
+
747
+ decisionReason?: string;
748
+
749
+ refusalSource?: string;
750
+
751
+ refusalMessage?: string;
724
752
  }
725
753
  interface AllocateSessionOptions {
726
754
  baseUrl: string;
@@ -735,9 +763,11 @@ interface AllocateSessionOptions {
735
763
 
736
764
  onAdmission?: (update: AdmissionUpdate) => void;
737
765
 
766
+
738
767
  onRequest?: (handle: {
739
768
  requestId: string;
740
769
  baseUrl: string;
770
+ sessionId?: string;
741
771
  }) => void;
742
772
 
743
773
  sessionKey?: string;
@@ -761,6 +791,8 @@ interface AllocatedSession {
761
791
  interface ReleaseSessionBeaconOptions {
762
792
  baseUrl: string;
763
793
  requestId: string;
794
+
795
+ sessionId?: string;
764
796
  orgId: string;
765
797
 
766
798
  jwt?: string;
@@ -1452,6 +1484,8 @@ declare class TransportSession {
1452
1484
 
1453
1485
  private _onStreamSeeked;
1454
1486
 
1487
+ private _reportUnknownServerStatus;
1488
+
1455
1489
  private _onStatus;
1456
1490
 
1457
1491
  private _webRtcDialHeld;
@@ -1541,19 +1575,11 @@ declare class TransportSession {
1541
1575
  private _isParkedPhase;
1542
1576
  private _setPhase;
1543
1577
 
1544
- reportAdmission(update: {
1545
- status: 'queued' | 'pending';
1546
- requestId?: string;
1547
- queue?: {
1548
- position: number;
1549
- depth: number;
1550
- };
1551
- runtime?: RuntimeAvailability;
1552
- }): void;
1578
+ reportAdmission(update: AdmissionUpdate): void;
1553
1579
 
1554
1580
  private _emitError;
1555
1581
 
1556
- reportAllocationFailure(error: Error, httpStatus?: number, code?: string): void;
1582
+ reportAllocationFailure(error: Error, httpStatus?: number, code?: string, retryAfterSeconds?: number): void;
1557
1583
  }
1558
1584
 
1559
1585
  declare class SessionDocumentImpl implements SessionDocument {
@@ -188,6 +188,8 @@ interface SessionPhaseError {
188
188
  kind?: SessionFailureKind;
189
189
 
190
190
  httpStatus?: number;
191
+
192
+ retryAfterSeconds?: number;
191
193
  }
192
194
 
193
195
  interface SessionDiagnostic {
@@ -461,9 +463,11 @@ interface RequestStreamOptions {
461
463
  }
462
464
 
463
465
  type SessionEndResult = {
464
- status: 'ended';
465
- requestId: string;
466
- platformStatus?: string;
466
+ status: 'paused';
467
+
468
+ sessionId: string;
469
+
470
+ reason: string;
467
471
  } | {
468
472
  status: 'canceled';
469
473
  requestId: string;
@@ -521,6 +525,8 @@ interface Session {
521
525
 
522
526
  end(): Promise<SessionEndResult>;
523
527
 
528
+ cancel(): Promise<SessionEndResult>;
529
+
524
530
  detach(): void;
525
531
 
526
532
  disconnect(): void;
@@ -676,7 +682,13 @@ interface App {
676
682
 
677
683
  type SessionGatewayStatus = 'allocated' | 'pending' | 'queued' | 'rejected' | 'failed' | 'canceled'
678
684
 
679
- | 'redirect';
685
+ | 'paused'
686
+
687
+ | 'redirect'
688
+
689
+ | 'waiting_for_capacity'
690
+
691
+ | (string & {});
680
692
  interface SessionGatewayResponse {
681
693
  status?: SessionGatewayStatus;
682
694
 
@@ -697,6 +709,14 @@ interface SessionGatewayResponse {
697
709
 
698
710
  runtime_reason?: string;
699
711
 
712
+ reason?: string;
713
+
714
+ decision_reason?: string;
715
+
716
+ provisioning_refusal_source?: string;
717
+
718
+ provisioning_refusal_message?: string;
719
+
700
720
  runtime_wake?: unknown;
701
721
 
702
722
  ends_at?: string;
@@ -711,7 +731,7 @@ interface SessionGatewayResponse {
711
731
 
712
732
  interface AdmissionUpdate {
713
733
 
714
- status: 'queued' | 'pending';
734
+ status: string;
715
735
 
716
736
  requestId?: string;
717
737
 
@@ -721,6 +741,14 @@ interface AdmissionUpdate {
721
741
  };
722
742
 
723
743
  runtime?: RuntimeAvailability;
744
+
745
+ reason?: string;
746
+
747
+ decisionReason?: string;
748
+
749
+ refusalSource?: string;
750
+
751
+ refusalMessage?: string;
724
752
  }
725
753
  interface AllocateSessionOptions {
726
754
  baseUrl: string;
@@ -735,9 +763,11 @@ interface AllocateSessionOptions {
735
763
 
736
764
  onAdmission?: (update: AdmissionUpdate) => void;
737
765
 
766
+
738
767
  onRequest?: (handle: {
739
768
  requestId: string;
740
769
  baseUrl: string;
770
+ sessionId?: string;
741
771
  }) => void;
742
772
 
743
773
  sessionKey?: string;
@@ -761,6 +791,8 @@ interface AllocatedSession {
761
791
  interface ReleaseSessionBeaconOptions {
762
792
  baseUrl: string;
763
793
  requestId: string;
794
+
795
+ sessionId?: string;
764
796
  orgId: string;
765
797
 
766
798
  jwt?: string;
@@ -1452,6 +1484,8 @@ declare class TransportSession {
1452
1484
 
1453
1485
  private _onStreamSeeked;
1454
1486
 
1487
+ private _reportUnknownServerStatus;
1488
+
1455
1489
  private _onStatus;
1456
1490
 
1457
1491
  private _webRtcDialHeld;
@@ -1541,19 +1575,11 @@ declare class TransportSession {
1541
1575
  private _isParkedPhase;
1542
1576
  private _setPhase;
1543
1577
 
1544
- reportAdmission(update: {
1545
- status: 'queued' | 'pending';
1546
- requestId?: string;
1547
- queue?: {
1548
- position: number;
1549
- depth: number;
1550
- };
1551
- runtime?: RuntimeAvailability;
1552
- }): void;
1578
+ reportAdmission(update: AdmissionUpdate): void;
1553
1579
 
1554
1580
  private _emitError;
1555
1581
 
1556
- reportAllocationFailure(error: Error, httpStatus?: number, code?: string): void;
1582
+ reportAllocationFailure(error: Error, httpStatus?: number, code?: string, retryAfterSeconds?: number): void;
1557
1583
  }
1558
1584
 
1559
1585
  declare class SessionDocumentImpl implements SessionDocument {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urun-sh/core",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "Core transport and channel primitives for the urun TypeScript SDK",
5
5
  "repository": {
6
6
  "type": "git",