@3dsource/angular-unreal-module 0.0.192 → 0.0.193

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3dsource/angular-unreal-module",
3
- "version": "0.0.192",
3
+ "version": "0.0.193",
4
4
  "description": "Angular integration for Unreal Engine Pixel Streaming",
5
5
  "keywords": [
6
6
  "3dsource",
@@ -11,7 +11,6 @@ interface UnrealInitialConfig {
11
11
  mode?: UnrealMode;
12
12
  playwright?: boolean;
13
13
  customErrorsEndpoint?: string;
14
- commandTelemetryReceiver?: string;
15
14
  regionsPingUrl?: string;
16
15
  screenLockerContainerId?: string;
17
16
  dataChannelConnectionTimeout?: number;
@@ -608,7 +608,7 @@ type Quality = 'lime' | 'red' | 'orange';
608
608
  * (`253.StreamTelemetry/src/app/telemetry/models/telemetry.types.ts`) — any
609
609
  * change here needs a paired edit there.
610
610
  *
611
- * Event taxonomy (8 names, 6 payload shapes):
611
+ * Event taxonomy (9 names, 7 payload shapes):
612
612
  * | event | payload |
613
613
  * |----------------------------|------------------------------------|
614
614
  * | `stream.session_started` | {@link SessionStartedData} |
@@ -619,6 +619,7 @@ type Quality = 'lime' | 'red' | 'orange';
619
619
  * | `stream.quality_recovered` | {@link QualityAnomalyData} |
620
620
  * | `stream.fps_low` | {@link FpsLowData} |
621
621
  * | `stream.signaling_retry` | {@link SignalingRetryData} |
622
+ * | `stream.pak_timing` | {@link PakTimingData} |
622
623
  */
623
624
  /**
624
625
  * Every stable id the service can put on the wire — phases, milestones,
@@ -626,7 +627,7 @@ type Quality = 'lime' | 'red' | 'orange';
626
627
  * every id added here needs a paired vocabulary row in the viewer
627
628
  * (`telemetry-vocabulary.ts`).
628
629
  */
629
- type EventId = 'region-resolving' | 'signaling-connection' | 'webrtc-negotiation' | 'unreal-communication' | 'region-ping-fetch-start' | 'region-ping-fetch-end' | 'region-resolved' | 'polling-started' | 'polling-ended' | 'aws-instance-resolved' | 'signaling-ws-connected' | 'instance-reserved' | 'instance-ready' | 'config-received' | 'ssinfo-received' | 'offer-received' | 'answer-sent' | 'answer-received' | 'first-ice-candidate' | 'last-ice-candidate' | 'datachannel-connected' | 'first-command-started' | 'loopback-sent' | 'loopback-received' | 'viewport-ready' | 'polling-to-instance' | 'signaling-handshake' | 'stabilization-warmup';
630
+ type EventId = 'region-resolving' | 'signaling-connection' | 'webrtc-negotiation' | 'unreal-communication' | 'region-ping-fetch-start' | 'region-ping-fetch-end' | 'region-resolved' | 'polling-started' | 'polling-ended' | 'aws-instance-resolved' | 'signaling-ws-connected' | 'instance-reserved' | 'instance-ready' | 'config-received' | 'ssinfo-received' | 'offer-received' | 'answer-sent' | 'answer-received' | 'first-ice-candidate' | 'last-ice-candidate' | 'ice-checking' | 'ice-gathering-complete' | 'ice-connected' | 'ice-failed' | 'datachannel-connected' | 'first-command-started' | 'loopback-sent' | 'loopback-received' | 'viewport-ready' | 'polling-to-instance' | 'signaling-handshake' | 'ice-connectivity-checks' | 'stabilization-warmup';
630
631
  /**
631
632
  * High-level cause of `stream.session_ended`.
632
633
  * - `disconnected` — Cirrus/WebRTC dropped us mid-stream (granular cause
@@ -941,6 +942,29 @@ interface SignalingRetryData extends TelemetryEventEnvelope {
941
942
  readonly reason: string;
942
943
  readonly kind: SignalingRetryKind;
943
944
  }
945
+ /** A command with ≥ 1 pak, send → `commandCallback` (by `correlationId`).
946
+ * Browser and Unreal clocks are never mixed. */
947
+ interface PakTimingItem {
948
+ /** Every `pakFilePath` of the command, comma-joined. */
949
+ readonly pak: string;
950
+ readonly command: string;
951
+ /** Anchor-relative ms. */
952
+ readonly sentMs: number;
953
+ /** Send → callback, browser clock. Absent when {@link lost}. */
954
+ readonly totalMs?: number;
955
+ /** `onRequestCommand` → `onStartCommand`, Unreal clock. */
956
+ readonly queueMs?: number;
957
+ /** `onStartCommand` → `onCompleteCommand`, Unreal clock. */
958
+ readonly execMs?: number;
959
+ /** No callback within 60 s, or the session ended first. */
960
+ readonly lost?: true;
961
+ }
962
+ /** `stream.pak_timing` — pak commands done during one 5 s window, all
963
+ * session long. Empty windows are not sent. */
964
+ interface PakTimingData extends TelemetryEventEnvelope {
965
+ readonly seq: number;
966
+ readonly items: readonly PakTimingItem[];
967
+ }
944
968
  /** Event name → payload. The authoritative index of the wire taxonomy. */
945
969
  interface StreamTelemetryEventMap {
946
970
  'stream.session_started': SessionStartedData;
@@ -951,6 +975,7 @@ interface StreamTelemetryEventMap {
951
975
  'stream.quality_recovered': QualityAnomalyData;
952
976
  'stream.fps_low': FpsLowData;
953
977
  'stream.signaling_retry': SignalingRetryData;
978
+ 'stream.pak_timing': PakTimingData;
954
979
  }
955
980
  type StreamTelemetryEventName = keyof StreamTelemetryEventMap;
956
981
  /** Names emitted via `emitLifecycle` — the three `duration`-carrying events. */
@@ -1302,7 +1327,6 @@ interface StreamResolutionProps {
1302
1327
  */
1303
1328
  type UnrealUiPart = 'resumeCard' | 'resumeText' | 'resumeButton' | 'afkScrim' | 'afkCard' | 'afkButton' | 'statusCard' | 'statusMessage';
1304
1329
  type UnrealUiClasses = Partial<Record<UnrealUiPart, string | string[]>>;
1305
- type TelemetryType = 'commandSent' | 'commandStop';
1306
1330
  export declare const InputOptions: InputProps;
1307
1331
  /** Disconnect reasons that should trigger remote connection cleanup. */
1308
1332
  export declare const DESTROY_DISCONNECT_REASONS: DisconnectReasonType[];
@@ -1427,94 +1451,6 @@ export declare class AggregatorService extends SubService {
1427
1451
  static ɵfac: i0.ɵɵFactoryDeclaration<AggregatorService, never>;
1428
1452
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
1429
1453
  }
1430
- export declare class CommandTelemetryService extends SubService {
1431
- private readonly appId;
1432
- private commandsSent;
1433
- private exileTimeout;
1434
- private pollingTime;
1435
- private commandSequenceNumber;
1436
- /**
1437
- * The time the telemetry service was started.
1438
- * Initialized at a moment when connectToSignaling() was called.
1439
- * @private
1440
- */
1441
- private startTime;
1442
- private lastTime;
1443
- private uuid;
1444
- private viewId;
1445
- private sessionId;
1446
- private userId;
1447
- private payloads;
1448
- private readonly httpClient;
1449
- private readonly unrealConfig;
1450
- constructor();
1451
- protected init(): void;
1452
- private get timeNow();
1453
- private get sessionTime();
1454
- private get canSkipSending();
1455
- decorate(funcToDecorate: ToBeDecorated): (data: MetaBoxCommandPacket) => void;
1456
- trackStartCommand(trackingId: string): void;
1457
- trackStopCommand(trackingId: string, multi?: boolean, response?: {
1458
- multi?: boolean;
1459
- } & Record<string, unknown>, timeStampsRaw?: TimeStampsRaw): void;
1460
- reset(): void;
1461
- private pushStatToBuffer;
1462
- private trackTime;
1463
- private send;
1464
- /**
1465
- * Listens for Unreal Engine callbacks.
1466
- * Subscribes to the Unreal Engine event loop back and filters out events that do not have a tracking ID.
1467
- * When a callback with a tracking ID is received,
1468
- * it stops tracking the time for that command and filters out commands
1469
- * that have exceeded the timeout limit.
1470
- */
1471
- protected listenCallbacks(): void;
1472
- private pushData;
1473
- /**
1474
- * Removes commands that have exceeded the timeout limit.
1475
- * Iterates over all the commands sent and checks if the difference between the current time
1476
- * and the time the command was sent is greater than the timeout limit.
1477
- * If it is, the command is marked for deletion.
1478
- * After checking all commands, those marked for deletion are removed from the commands sent.
1479
- * This method is used to ensure that commands that are not responded to within a certain time frame
1480
- * do not remain in the commandsSent object indefinitely, which could lead to memory leaks over time.
1481
- */
1482
- private removeExileCommands;
1483
- /**
1484
- * Wraps the provided function with telemetry tracking.
1485
- * Generates a unique tracking ID and adds it to the data object.
1486
- * Pushes the command sent to the payloads with the tracking ID.
1487
- * Starts tracking the time for the command.
1488
- * Finally, calls the provided function with the modified data object.
1489
- *
1490
- * @param {ToBeDecorated} funcToDecorate - The function to be decorated with telemetry tracking.
1491
- * @param {MetaBoxCommandPacket} data - The data object to be passed to the function. It will be augmented with a unique tracking ID.
1492
- */
1493
- private wrapper;
1494
- static ɵfac: i0.ɵɵFactoryDeclaration<CommandTelemetryService, never>;
1495
- static ɵprov: i0.ɵɵInjectableDeclaration<any>;
1496
- }
1497
- type ToBeDecorated = (data: MetaBoxCommandPacket) => void;
1498
- interface TimeStampsRaw {
1499
- timeStampPak: TimeStampPakCollection;
1500
- timeStampCommand: TimeStampCommandCollection;
1501
- }
1502
- interface TimeStampPakCollection {
1503
- onLoadPak: TimeStampMemory;
1504
- onRenderPak: TimeStampMemory;
1505
- onSequencePak: TimeStampMemory;
1506
- onSpawnPak: TimeStampMemory;
1507
- }
1508
- interface TimeStampMemory {
1509
- timestamp: number;
1510
- ram: number;
1511
- vRam: number;
1512
- }
1513
- interface TimeStampCommandCollection {
1514
- onRequestCommand: TimeStampMemory;
1515
- onStartCommand: TimeStampMemory;
1516
- onCompleteCommand: TimeStampMemory;
1517
- }
1518
1454
  export declare class ConsoleExtensionsService extends SubService {
1519
1455
  #private;
1520
1456
  private readonly unrealConfig;
@@ -1734,7 +1670,6 @@ interface Region {
1734
1670
  export declare class SignallingService extends SubService {
1735
1671
  private readonly httpClient;
1736
1672
  private readonly regionsPingService;
1737
- private readonly commandTelemetryService;
1738
1673
  private readonly unrealConfig;
1739
1674
  readonly region: import("@angular/core").WritableSignal<string>;
1740
1675
  readonly selectClientAndViewIds: import("@angular/core").Signal<{
@@ -1803,8 +1738,7 @@ export declare class SignallingService extends SubService {
1803
1738
  private requestCirrusDirect;
1804
1739
  /**
1805
1740
  * HTTP-orchestration path. Brackets {@link pollLoop} with `pollingStarted`/
1806
- * `pollingEnded` and the `EXT-getSignaling` telemetry span (started in `defer`,
1807
- * stopped in `finalize` with the last response from the closure).
1741
+ * `pollingEnded` (dispatched in `defer` and `finalize`).
1808
1742
  */
1809
1743
  private requestCirrusViaPolling;
1810
1744
  /**
@@ -1989,6 +1923,7 @@ export declare class StreamStatusTelemetryService2 {
1989
1923
  private readonly actions$;
1990
1924
  private readonly videoService;
1991
1925
  private readonly signallingService;
1926
+ private readonly webRtcPlayer;
1992
1927
  private readonly unrealConfig;
1993
1928
  private readonly destroyRef;
1994
1929
  private readonly destroy$;
@@ -2052,6 +1987,8 @@ export declare class StreamStatusTelemetryService2 {
2052
1987
  private readonly awsInstanceResolvedEntry;
2053
1988
  private readonly loopbackReceivedEntry;
2054
1989
  private readonly signalingServerConnectedEntry;
1990
+ private readonly iceCheckingEntry;
1991
+ private readonly iceConnectedEntry;
2055
1992
  private readonly configReceivedEntry;
2056
1993
  /**
2057
1994
  * Unified phase catalog — the single source of truth for everything
@@ -2128,6 +2065,11 @@ export declare class StreamStatusTelemetryService2 {
2128
2065
  private adoptedSignalingParams;
2129
2066
  private handleWindow;
2130
2067
  private evaluateAnomalies;
2068
+ /** Ship the pak commands finished this window as one `stream.pak_timing`;
2069
+ * `final` also gives up on the ones still waiting (session is ending). */
2070
+ private flushPaks;
2071
+ /** ICE connection state changes into any of `states`. */
2072
+ private iceConnection$;
2131
2073
  private updateMaxFpsTarget;
2132
2074
  /**
2133
2075
  * Snapshot every milestone recorded in this session that belongs to
@@ -2173,7 +2115,6 @@ export declare class StreamStatusTelemetryService2 {
2173
2115
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
2174
2116
  }
2175
2117
  export declare class UnrealCommunicatorService extends SubService {
2176
- private readonly commandTelemetryService;
2177
2118
  private readonly webRtcPlayerService;
2178
2119
  private readonly unrealConfig;
2179
2120
  private cirrusConnected;
@@ -2281,13 +2222,43 @@ export declare class VideoService extends SubService {
2281
2222
  static ɵfac: i0.ɵɵFactoryDeclaration<VideoService, never>;
2282
2223
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
2283
2224
  }
2225
+ declare function finite(value: unknown): number | undefined;
2226
+ /** The `local-candidate` / `remote-candidate` fields read here — the DOM lib
2227
+ * in use does not declare RTCIceCandidateStats. */
2228
+ interface IceCandidateStats {
2229
+ candidateType?: string;
2230
+ protocol?: string;
2231
+ address?: string | null;
2232
+ port?: number;
2233
+ url?: string;
2234
+ relayProtocol?: string;
2235
+ }
2236
+ /**
2237
+ * The route-relevant fields of one candidate. The address is uploaded for a
2238
+ * relay candidate only — host / srflx addresses identify the user, a relay
2239
+ * address identifies the TURN provider's region.
2240
+ */
2241
+ declare function candidateInfo(candidate: IceCandidateStats | undefined, isLocal: boolean): IceCandidateInfo;
2242
+ /** Id of the selected candidate pair: the transport's pick, or Firefox's
2243
+ * pre-standard `selected` flag when there is no `transport` report. */
2244
+ declare function selectedPairId(stats: RTCStatsReport): string | undefined;
2245
+ /** Candidates per side by type, pairs by check state, and the selected pair. */
2246
+ interface IceSnapshot {
2247
+ readonly local: Readonly<Record<string, number>>;
2248
+ readonly remote: Readonly<Record<string, number>>;
2249
+ readonly pairs: Readonly<Record<string, number>>;
2250
+ readonly selected: IceRoute | null;
2251
+ readonly selectedRttMs?: number;
2252
+ }
2253
+ declare function iceSnapshot(stats: RTCStatsReport): IceSnapshot;
2284
2254
  export declare class WebRtcPlayerService extends SubService {
2285
2255
  onDataChannelMessage$: Subject<ArrayBuffer>;
2256
+ /** ICE connection / gathering state changes of the current peer connection. */
2257
+ readonly iceState$: Subject<IceStateChange>;
2286
2258
  private pcClient;
2287
2259
  private dcClient;
2288
2260
  private readonly signallingSrv;
2289
2261
  private readonly videoService;
2290
- private readonly commandTelemetryService;
2291
2262
  private cfg;
2292
2263
  private useMic;
2293
2264
  private forceTURN;
@@ -2381,6 +2352,8 @@ export declare class WebRtcPlayerService extends SubService {
2381
2352
  */
2382
2353
  releaseRemoteConnections(reason: DisconnectReasonType): void;
2383
2354
  canSend(): boolean | null;
2355
+ /** ICE of the current peer connection; `null` without one or on a failed read. */
2356
+ readIceSnapshot(): Promise<IceSnapshot | null>;
2384
2357
  describeConnectionState(): string;
2385
2358
  send(data: ArrayBuffer): void;
2386
2359
  /**
@@ -2426,6 +2399,13 @@ export declare class WebRtcPlayerService extends SubService {
2426
2399
  static ɵfac: i0.ɵɵFactoryDeclaration<WebRtcPlayerService, never>;
2427
2400
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
2428
2401
  }
2402
+ export type IceStateChange = {
2403
+ readonly kind: 'connection';
2404
+ readonly state: RTCIceConnectionState;
2405
+ } | {
2406
+ readonly kind: 'gathering';
2407
+ readonly state: RTCIceGatheringState;
2408
+ };
2429
2409
  declare const ReceivedMimeTypes: {
2430
2410
  readonly ApplicationJson: "application/json";
2431
2411
  };
@@ -2865,7 +2845,8 @@ export declare function provideUnrealModule(): import("@angular/core").Environme
2865
2845
  */
2866
2846
  export interface UnrealCallbackJsonWrapped {
2867
2847
  commandCallback: MetaBoxCommandPacket;
2868
- timeStamp?: unknown;
2848
+ /** Unreal's own stamps; some builds send `timeStamp` — read via `callbackStamps`. */
2849
+ timestamp?: unknown;
2869
2850
  }
2870
2851
  export type UnrealCallbackJson = UnrealCallbackJsonWrapped | MetaBoxCommandPacket;
2871
2852
  export declare const unrealCommandCallback: import("@ngrx/store").ActionCreator<string, (props: {
@@ -2877,10 +2858,12 @@ export declare const commandStarted: import("@ngrx/store").ActionCreator<string,
2877
2858
  id: string;
2878
2859
  command: string;
2879
2860
  timeStamp: number;
2861
+ paks?: string;
2880
2862
  }) => {
2881
2863
  id: string;
2882
2864
  command: string;
2883
2865
  timeStamp: number;
2866
+ paks?: string;
2884
2867
  } & import("@ngrx/store").Action<string>>;
2885
2868
  export declare const commandCompleted: import("@ngrx/store").ActionCreator<string, (props: {
2886
2869
  id: string;
@@ -3336,7 +3319,6 @@ export declare class UnrealEffects {
3336
3319
  private readonly unrealInitialConfig;
3337
3320
  private readonly webRtcPlayerService;
3338
3321
  private readonly commandsSender;
3339
- private readonly commandTelemetryService;
3340
3322
  private readonly regionsPingService;
3341
3323
  private readonly signallingService;
3342
3324
  private readonly streamAdoptionService;
@@ -3779,4 +3761,4 @@ export declare class Semaphore {
3779
3761
  release(): void;
3780
3762
  }
3781
3763
  export declare const tapLog: <T>(text: string, ...args: unknown[]) => ((source: Observable<T>) => Observable<T>);
3782
- export { ALL_KEYBOARD_KEYS, type AggregatedStat, type Area, type AwsInstance, type BootstrapInfo, type CirrusRequestKind, type CloseReason, type Coords, type EmittedMilestone, type EventId, type FpsLowData, type FreezeFrameMessage, type IKeyCode, type IKeyCodeName, type IKeyName, IME_PROCESS_KEY, type IceCandidateInfo, type IceRoute, type ImageOutputValues, type InboundVideoStats, type InputProps, MODIFIER_KEY_CODES, type PhaseEndedData, type PhaseOverlay, type PhaseParam, type Quality, type QualityAnomalyData, type Rect, type RegionPick, type RegionProbes, type RegionSource, type ResourceBucket, type ResourceTotals, type RouteSegment, type SampleData, type SelectedIceCandidatePair, type SessionEndReason, type SessionEndedData, type SessionStartedData, type SignalingData, type SignalingRetryData, type SignalingRetryKind, type Size, type SlowResource, type StreamConfig, type StreamResolutionProps, type StreamTelemetryEvent, type StreamTelemetryEventMap, type StreamTelemetryEventName, type StreamTelemetryLifecycleData, type StreamTelemetryLifecycleEventName, type StreamTelemetryTrackData, type TelemetryEventEnvelope, type TelemetryLifecycleEnvelope, type TelemetryType, UNREAL_CONFIG, type UnrealAfkSlotContext, type UnrealInitialConfig, UnrealKeyCode, type UnrealMode, type UnrealResumeSlotContext, type UnrealSlotTemplateContext, type UnrealStatusSlotContext, type UnrealUiClasses, type UnrealUiPart, type WindowAggregate };
3764
+ export { ALL_KEYBOARD_KEYS, type AggregatedStat, type Area, type AwsInstance, type BootstrapInfo, type CirrusRequestKind, type CloseReason, type Coords, type EmittedMilestone, type EventId, type FpsLowData, type FreezeFrameMessage, type IKeyCode, type IKeyCodeName, type IKeyName, IME_PROCESS_KEY, type IceCandidateInfo, type IceRoute, type ImageOutputValues, type InboundVideoStats, type InputProps, MODIFIER_KEY_CODES, type PakTimingData, type PakTimingItem, type PhaseEndedData, type PhaseOverlay, type PhaseParam, type Quality, type QualityAnomalyData, type Rect, type RegionPick, type RegionProbes, type RegionSource, type ResourceBucket, type ResourceTotals, type RouteSegment, type SampleData, type SelectedIceCandidatePair, type SessionEndReason, type SessionEndedData, type SessionStartedData, type SignalingData, type SignalingRetryData, type SignalingRetryKind, type Size, type SlowResource, type StreamConfig, type StreamResolutionProps, type StreamTelemetryEvent, type StreamTelemetryEventMap, type StreamTelemetryEventName, type StreamTelemetryLifecycleData, type StreamTelemetryLifecycleEventName, type StreamTelemetryTrackData, type TelemetryEventEnvelope, type TelemetryLifecycleEnvelope, UNREAL_CONFIG, type UnrealAfkSlotContext, type UnrealInitialConfig, UnrealKeyCode, type UnrealMode, type UnrealResumeSlotContext, type UnrealSlotTemplateContext, type UnrealStatusSlotContext, type UnrealUiClasses, type UnrealUiPart, type WindowAggregate };